Showing posts with label interview. Show all posts
Showing posts with label interview. Show all posts

Wednesday, May 11, 2011

Technical Interview Questions I

I have close to only 1.5 years experience as a Software Engineer (2 companies) and I have appeared for quite a few technical interviews! These 2 firms have been really rigorous and multiple attempts have made my question-bank grow well. Here are some of the questions I was asked -

1. You have 100 balls, out of which 1 is defective (heavier or lighter, you don't know). You have 1 scale (2 pans) and you can use it only once. So in just 1 weigh, identify a good (non-defective) ball.

2. You are given a N*M matrix. Starting from the top left cell, you have to reach the bottom-right cell, 1 cell at a time. You can only move right or bottom. In how many ways can you do this ?

3. There is a staircase with n steps. A boy can climb 1 step at a time, or 2 steps at a time, or 3 steps at a time...... or k steps at a time. In how many ways can he climb the staircase ?
Example (5 stairs, k = 3): {1,1,1,1,1}, {3,1,1}, {2,3},{1,3,1}... and so on.

4. Given an array, generate a random permutation and prove that it is random.

5. How many rectangles are there on a chess board ?

6. Given a set {1,2,3,4,....n}, write code to generate all subsets.

7. A needle (length l) drops on a page which has parallel lines drawn on that. Line spacing is s. The needle makes angle theta with the lines. What is the probability that the needle does not touch the lines ?

8. There are 2 linked lists that intersect at a point. How will you find the point of intersection ? (You can visit each node twice)

9. There is a beaker full of H2SO4 (100% conc). Now water is being poured in the beaker at the rate of r/sec. At the same time, the contents of the beaker are leaking at the rate of r/sec. In how much time, will the concentration of H2SO4 in the beaker become half ?

10. (a) Implement a queue using 2 stacks. (b) Design a data structure in which push(), pop() and max() functions are all O(1).

Tuesday, November 11, 2008

What a waste of opportunity !!!

What a waste of opportunity.....

I managed to get shortlisted somehow (my killer looks :P, cgpa, extra-currics, i-bank interns*2) It could have been anything!! Well, how does it matter… I was there with some of the stud people sharing a common goal – DEUTSCHE BANK!!!

Already many were eliminated after the first round and as usual I was busy with my weird thoughts and imagination when suddenly 'A' entered the room and I heard my name in a bold voice – “Surabhi !”
I sprang up, straight to the door and after a firm handshake I was finally facing him… He asked a couple of questions and I answered completely forgetting it was an interview.. I was relaxed and comfortable, confident and to-the-point. I knew he liked direct crisp answers and that’s what I gave him. So the interview was good and I came back 90% sure I would get through this first round.

So after some time a pretty HR came with a list of people. She was fumbling with Indian names when suddenly I heard ‘Saurabh Jain’. I was quite sure that no such guy has come for the interview and this is a result of mispronunciation!! Quite happy I was, and in excitement just forgot that there was second round to go and I am supposed to give my best in that also.

So when the time came for 2nd round, I went, a bit too relaxed and content. Not even one answer of mine gave an impression of achievement, enthu or anything which would make them like me. I could not drive the conversation, was quite boring and dull, I did not even sound interested to answer his specific questions. I lost it, completely. I guess I am one of the few people who knows how close it was and then what went wrong.

Anyways, if you ask me, yes I am disappointed specially when I think about the magnitude of the opportunity. It was crucial, too crucial to just let go. I would have been relieved of so much tension and arbit pondering over the job-scene. A piece of free advice – NEVER TAKE THINGS LIGHTLY SPECIALLY AT THE LAST MOMENT