Monday, September 15, 2008

Adobe Interview of Rinky Gupta

Q: Given length and precision(ex: 1/8) draw scale. each unit shd have different height. Draw same as the scale we generally use.

Q: a)Implement stack.(write constructor, destructor,push,pop).
b)Implement Quesue using stack. Optimise the enqueue and dequeue operations.

Q: Difference b/w program and process. How a process executes(Interviewer was expecting program counter etc etc)


Q: There are 3 string S1, S2 and S3. Replace all occurances of S2 in S1 with S3. S3 and S2 can be of any length. Length of S2 can be greater equal or less than that of S3. Result is new string.

Q: There are n guests in a party. A guest can make any numbr of handshakes(0 to n-1) . Prove that there are atleast 2 guest having same number of handshakes.(Can be proved using induction as well as Contradiction)

Q: Difference b/w reference and pointer and where do we use each. What is advantage of 1 over other. When is the memory allocated for each.

Q: Two trains are moving towards each other with different speeds on same track. A bird is moving to and fro. Find the distance travlled by bird till the trains meet.

Q: 100 floors. 2 eggs. find the lowest floor from which the egg breaks in min number of throws.

Q: 50 Red balls and 50 blue balls. 2 empty baskets. A person has to choose 1 basket at random and then pick 1 ball out of it at random. Distribute the balls to maximise the probability of picking up red ball.

Q: Find the subsequence of max sum from array of +ve and -ve numbers.

Q: There is an array of N elements having values in range 0 to N-1. a value can be repeated any number of times. Do some preprocessing so that the count of a particular value can be determined in O(1) after preprocessing. Do not use any extra array to store the counts. Same array can be modified to strore counts for each value.

Q: A float f is given and digits d. return the string having the value with d sigits after decimal.

Q: a)Find the maximum and the min value an integer can store.
b)Implementation of sizeof.
c)Used number of bits to find the max and min value
d)Use complement to find the max value of integer(complement 0 and reset the signed bit to get max value) All these questions were linked from 1 to other.

Q: Rotate integer n bits right.

Q: Two linked lists having a common node. Find the node.

Q: 1,2,4,6 and operators + - * / . Operators can be used any number of times. Write expressions to make 24 and 25

Q: 5,5,5,5,5 and any operators. Make 37.

Q: 2 cans of 10L each full with water. An empty can of 4L and another of 5L. move 2L to each of 4and 5 can.

Q: Reverse linked list.

Q: Few questions on output of C++ codes.

Q: A chess board 8X8 given(area 64 units). 31 slabs of 2X1 each(area 62 units). Arrange slabs on chessboard such that top-left and bottom-right corners are left empty.

Q: There are 100 prisoners. The jailor will make them stand in a row 1 after other, so that each person can see the people in front of him. The he will put caps of red and black color at random on head of each prisoner. There can be any number of red and black caps. The person telling the right color of his hat would survive, others dead. One person can speak one word i.e. the color of his hat.Before the activity the prisoners can think of some protocol to be followed so that max number can survive. No one would cheat. Decide the protocol that shd be followed.


No comments:

Post a Comment