Tuesday, April 1, 2008

Problems that you need to send right away

Other common practice is to have a coding question during your phone interview or sent over email that you need to code and send back within an hour. So here are several examples of coding questions I received and needed to solve right away:
1. Write a function that would: return the 5-th element from the end in a single linked list of integers, in one pass, and then provide a set of test cases against that function.
(Hint: Try to solve this problem for n-th element and afterwards invoke it for 5-th one)
2. Implement queue using two stacks. Originally the problem was using data structure stack and you need to come with the conclusion that you need 2 of them:)
3.You have a very large linked list that is circular(the last node is pointing to the first one) and you have pointer to the first element. Insert an element after the last one. (Think optimisation).

Try to solve these problems fast - an hour per problem, writing the code in visual studio or other siutable enviroment:) Take care:)

No comments: