Recent Interview Questions
More Questions »We are given a set of n distinct elements and an unlabeled binary tree with n
nodes. In how many ways can we populate the tree with the given set so that it
becomes a binary search tree?
Assume we have n people. Each one has a starting time and ending time. For any people, set flag to true if his/her time range overlaps with anyone else's.
Need O(n) solution or very simple O(nlog(n)) solution.
Imagine you are a contractor who builds houses. Building of every house takes man power. Example: HouseA (manpower to build 20 days, profit when sold = 20K,
HouseB manpower to build = 5 days, profit when sold = 11K,
HouseC manpower to build = 5 days and porfit = 10.5K )
Write a function which takes total available manpower as parameter and returns which house building will give max profit.
So for this example if we pass 15 days to the function the answer would be HouseB and HouseC.
Out put ?
#define SQUARE(x) x*x
main() {
int s;
s = 64/SQUARE(4);
print ("%d", s);
}A. 4 B. 64 C. 16 D. 128
Ans: Answer is 64 -> 64/4*4
Question on &&, || and ++ operator. Give an expression with combination of these operators and asked to choose evaluated output.



