Thursday, May 23, 2013

Top 10 Most Overused Coding Interview Questions

These are questions that I've been asked at least twice, sometimes even more. I think there's a pretty good chance of running into at least one of them during an interview at a typical tech firm. Note that for some of the bigger compaies like Google or Microsoft, these are usually just "screening" questions, you'll get much tougher ones at the real in-person interviews.

1. Write a function to calculate the Nth number in a Fibonacci sequence.

2. Write a function to reverse words in a string.

3. Implement a data structure that behaves like a heap but only using stacks.

4. Write a function to reverse a linked list.

5. How do you find out if a linked list is cyclical?

6. Given a series of numbers, find the longest sequence of numbers that add up to the largest sum.

7. Given a list of 101 numbers from 1 to 100, with a number being duplicated, find the duplicate number.

8. Implement the itoa() function (converting an integer to a string).

9. Try to implement the divide operator without using any actual division (or modulo).

10. Write the preorder, postorder, and inorder traversal functions for a binary tree.


No comments:

Post a Comment