Monday, January 14, 2008

Interview questions (3)

Here's an addition to some of the more interesting interview questions I have received during my job hunt

1. How would you write your own garbage collector ?
The crux of the question is how would you identify which objects need to be garbage collected. Here, they are trying to test your knowledge of the heap and call stack.

2. You've got an array of numbers. They are not sorted. How do you find the the first pair that sums to X (a given number)
They're looking for an optimized solution. The most obvious solution is an n^2 solution and thats not what they want...
Hint: Think about which data structure you could use.

No comments:

Search This Blog