X

View By:

Q1
**Facebook Programming Challenge - Bar Problem - N friends are playing a game**

N friends are playing a game. Each of them has a list of numbers in front of himself.

Each of N friends chooses a number from his list and reports it to the game administrator. Then the game administrator sorts the reported numbers and shouts the K-th largest number.

You want to know the count all possible numbers that the game administrator can shout.

Input Format:

First line of the input contain an integer T, the number of testcases. Then follow T testcases. For each test case the input is of the following format.

In the first line there are two numbers N and K. In each of next N lines there is an integer a_i followed by a_i integers, ith line describes the list for ith person.

All the numbers ...

show more

Q2
**Regarding Flipkart online exam**

Hi There. I have a flipkart online exam scheduled. Can anyone help me with the test pattern for Flipkart online exam for MySql and Java?
I meant what sort of questions they might ask?
Thanks :)

Q3
**Custom Sort**

You have a set of numbers. a1, a2, a3, a4.....an.
numbers are random and may repeat.

Arrange the number in order such that x1 > x2 < x3 > x4 < x5 > x6.......

x1 has no relation ship with x3, x4, x5... x2 has no relation ship with x4, x5... x3 has no relation ship with x1, x5, x6... and so on.

There maybe many feasible solution to this problem see that the final answer reaches any one of them. If the input is like 22,22,22 then it should output a message as no feasible solution but for an input like this 7 7 7 3 3 it should print out a solution like : 7 3 7 3 7.

Q4
**Website Development in Ohio? Ohio Web seo consulting?**

Website Development in Ohio? Ohio Web seo consulting?

Q5
**BasketBall game**

A group of N high school students wants to play a basketball game. To divide
themselves into two teams they first rank all the players in the following
way:

Players with a higher shot percentage are rated higher than players with a lower shot percentage. If two players have the same shot percentage, the taller player is rated higher.

Luckily there are no two players with both the same shot percentage and height
so they are able to order themselves in an unambiguous way. Based on that
ordering each player is assigned a draft number from the range [1..N], where
the highest-rated player gets the number 1, the second highest-rated gets the
number 2, and so on. Now the first team contains all the players with the odd
draft numbers and ...

show more

Q6
**Sequence of vowels and consonant**

In the English alphabet, the letters A, E, I, O and U are vowels. Y is also
considered to be a vowel if it's not preceded by another vowel and is not the
first letter in a word (the fact that a vowel is defined to some extent in
terms of itself does not make it ambiguous). If a letter is not a vowel then
it is a consonant. So in "TOY" the consonants are T and Y, and in "SYZYGY"
they are S, Z and G.

A sequence of vowels will be denoted by uppercase letter 'V' and a sequence of
consonants will be denoted by uppercase letter 'C'. A word can then be
described as an alternating sequence of 'C' and 'V'. For instance, the word
"WHEREABOUTS" has the sequence CVCVCVC, and the words "YORK" and "TOY" both
have the sequence CVC. It's not permissible...

show more

Q7
**Puzzle "Parlor "**

Beautiful You Pvt. Ltd. owns several parlors. Research has shown that if a
customer arrives and there is no staff available to service them, the customer
will turn around and leave, thus costing the company a sale. Your task is to
write a program that tells the company how many customers left without getting
any service.

Problem Definition:

The samples below consists of function calls for 4 parlors. Function call for each parlor contains a positive integer, representing the number of staff in the parlor, followed by a sequence of uppercase letters.

Letters in the sequence occur in pairs. The first occurrence indicates the
arrival of a customer; the second indicates the departure of that same
customer. A customer will be ser...

show more

Q8
**PONY **

Discord is in trouble for causing discord, so he is trying to escape from Equestria. He's arrived at the port, and he doesn't care what boat he gets on, he just wants to get out. He can see the boat schedule, where he sees that N boats are arriving today,

boat 1 arrives any time within a_1 minutes

boat 2 arrives any time within a_2 minutes

...

boat N arrives any time within a_N minutes (uniform distribution)

Tell discord the expected number of minutes he needs to wait for a boat to arrive.

For example If n=3 , and there arriving times are 49,50,51 respectively then expected number of minutes would be 12.495000 . Thats all I know .

Q9
**Log parser**

Each time a visitor requests a page from our website, our webserver writes a
log entry recoding the visitor's identity and the kind of page requested.
Entries are written in chronological order to a plain-text file, with one
entry per line. The format of each entry is:

user-id page-type-id

User IDs are arbitrary strings that uniquely represent a given user; if a user visits multiple pages, each log entry will have the same user ID. Page type IDs are arbitrary strings that uniquely represent a given kind of page on our site, such as the homepage, a product detail pages, or the shopping cart. Tons of users visit our website, but there are only a few dozen types of pages.

We can use our weblogs to answer questions about use...

show more

Q10
**SDET Interview**

1) Print All k size subset of given array of size n