X

# Interview Questions

View By:

Q1 Star rating system

[HTML_REMOVED]

Q2 Flatten array of arrays

Write a program to Merge/flatten an Array of Arrays in JavaScript

Find the nth last element of the single linked list

Q4 how to kill a hen who is not giving egg since 10 days.

There are many number of hens (say 1000 ) in a poultry farm. One out of them is not laying egg since last 10 days.

How to kill that hen ?

Q5 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 ...

Q6 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 :)

Q7 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.

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 ...

Q9 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 permissibl...