Friday 29 April 2011

Some Puzzles

1) find median of two sorted array
2) intersection of two set
3) union of two set
4) given a n*n matrix row and column are sorted in ascending order , given an element find its position
5) same as 4 containg -ve also, find number of -ve
6) same as 4 print the matrics in sorted order
6) longest palindromic substring
7) longest repeatative word
8) loop in a linked list, with proof, delete, and count number of nodes
9) merge two sorted linked list without creating new
10) least common ancestor of a bst/binary tree
11) reverse a stack
12 ) implement queue using a single stack
13) caching techniques
14) closest pairs of points in a plane
15) kth smallest element in most optimum way
16) reservior sampling
17) max submatrix of a n*n matrics
18) an array contains three color balls red,green and blue. sort the array in such a way so that all red will be in the begining, all blue will be in middle and green will be at the end
19) check a graph is circular or not
20) how do you serialize a graph/tree
21) design a deck of card with shuffling algo(knuth shuffling algo)
22) design a parking station
23) how will you design stl vector
24) design a traffic signal
25) design a garbage collector
26) sort nuts and bolts you don't have anything to measure the lenght
27) there are 25 horses, 5 horse can run at a time, you dont have watch to measure time, find top 3 horses, in mim numbr os races
28) load balancing techniques

No comments:

Post a Comment