Interview and Written Questions …..Continued

So far, we had some 10 posts on various interview questions, written paper stuff  and etc. 

This is in contination of those posts. So It will be Part 11 ! 

I am not going to say, these questions are asked only in Adobe or a specific company, but given the tight situations everywhere, it is better and necessary to prepare hard and be competetive.  So, this new set of collection has got some of the best and toughest questions along with the most expected ones. Please make a note of all of them, and yes, forward to many others and ur friends. Its for all of our benifit.

Also, going ahead, please let us know, if anyone of u need any specific type of material etc, say for QE or some other. We would try our best to provide it. 

PART 11 – Interview and Written Questions for Dev

————————————————————————————————————————————————————–

1) Implement ARP Cache:key and value is there , write function for lookup , addvalue; it can only store only one million entries; do come with a good strategy to delete nodes close to expiry

2) Implement hot queries ? 

hot queries are queries whose usage has increased 25 times in last one hour ? 

3) there are m children and n balconies. there are many conditions such that m(i)#m(j) such m(j) cannot seat infront of m(i) 

how will u arrange them in n balconies ?; in one of the cases soln not possible ? tell the case ? 

4) there are no nos in an array

2 1 8 0 -1 5 3 9;

find the max length and the longest sequence in which the next no increases 

e.g.2,8,9; 1,8,9; 2,5,9; 2,3,9; 0,3,9; -1,3,9 ; 0,5,9; -1,5,9

ans is 3 and and ne one of teh above sequence

5) In an array of length n , only k distinct elements are possible. sort it in O(klogn) ? 

6) In an array of length n,find the element (if exists) which is present more than n/2 times ? 

7) when u type brittani spiers instead of britney spears in google , it searches for error via spell check try to give possible ways to do it ? 

all considerations , i mean

8) diff between inline func and a macro , diff between inline func and a normal func 

————————————————
Some Puzzles: (Very much essential , be it for Dev, QE or any other)
——————————————————————————————-
1. How many golf balls can fit in a school bus?  
2. You are shrunk to the height of a nickel and your mass is proportionally reduced so as to maintain your original density. You are then thrown into an empty glass blender. The blades will start moving in 60 seconds. What do you do? 
3. How much should you charge to wash all the windows in Seattle?
4. How would you find out if a machine’s stack grows up or down in memory? 
5. Explain a database in three sentences to your eight-year-old nephew. 
6. How many times a day does a clock’s hands overlap? 
7. You have to get from point A to point B. You don’t know if you can get there. What would you do? 
8. Imagine you have a closet full of shirts. It’s very hard to find a shirt. So what can you do to organize your shirts for easy retrieval? 
9. Every man in a village of 100 married couples has cheated on his wife. Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announces that at least one husband has been unfaithful. What happens? 
10. In a country in which people only want boys, every family continues to have children until they have a boy. if they have a girl, they have another child. if they have a boy, they stop. what is the proportion of boys to girls in the country? 
11. If the probability of observing a car in 30 minutes on a highway is 0.95, what is the probability of observing a car in 10 minutes (assuming constant default probability)? 
12. If you look at a clock and the time is 3:15, what is the angle between the hour and the minute hands? (The answer to this is not zero!) 
13. Four people need to cross a rickety rope bridge to get back to their camp at night. Unfortunately, they only have one flashlight and it only has enough light left for seventeen minutes. The bridge is too dangerous to cross without a flashlight, and it’s only strong enough to support two people at any given time. Each of the campers walks at a different speed. One can cross the bridge in 1 minute, another in 2 minutes, the third in 5 minutes, and the slow poke takes 10 minutes to cross. How do the campers make it across in 17 minutes? 
14. You are at a party with a friend and 10 people are present including you and the friend. your friend makes you a wager that for every person you find that has the same birthday as you, you get $1; for every person he finds that does not have the same birthday as you, he gets $2. would you accept the wager? 
15. How many piano tuners are there in the entire world? 
16. You have eight balls all of the same size. 7 of them weigh the same, and one of them weighs slightly more. How can you find the ball that is heavier by using a balance and only two weighings? 
17. You have five pirates, ranked from 5 to 1 in descending order. The top pirate has the right to propose how 100 gold coins should be divided among them. But the others get to vote on his plan, and if fewer than half agree with him, he gets killed. How should he allocate the gold in order to maximize his share but live to enjoy it? (Hint: One pirate ends up with 98 percent of the gold.) 
——————————————————————————————————————————————
Some more highly technical dev stuff!! 
————————————————
1. Inorder traversal of BST is given, make the tree. ——–> not possible
Preorder travesal of BST is given, make the tree.———–>possible
You are to desing a login system, in which users from different countries can login,
design it.
2. Find no. of trailing 0’s in factorial(100)
3. You are given a histrogram. Find the recatangle of maximum area which can be formed in this Histrogram.
I proposed a simple O(n^2) solution.
4. an array is given, find the no. whose sum is equal to the given no.
ans: sort the array, take two pointers, statring from both the ends of array.
5. There are 2 robots, executing same set of instructions, are on a Infinite road. THere is a
marker on the road, whenever robot touches the marker , it will come to know of this.Each robot is on the other side of marker. A robot doesn’t know , in which directon it should move to hit the marker. How would u collide them. 
Ans: move both the robots in the same direction. As soon as any robot hits the marker, start moving it faster. soon it will collide with second one.
6. YOu are given a file having a string of infinte length.Search qureies are made for the strings in this file. How would u store the queries to make search efficient.
7. there are n threads, each of them want to execute a particulat method. how would u write the code , so that the thread which got created earlier  should call the method first.
for solution read thread synchronization.
8. There are n companies, they are to be mergerd. But only  2 companies can be merged at a time. How many ways are possible to merge them.
———————————————————————————————————————————————————————
All the very best,
WorthvieW Team.
———————————————————————————————————————————————————————

One thought on “Interview and Written Questions …..Continued

Comments are closed.