Possible Duplicate:
Algorithm/Data Structure Design Interview Questions
Share some of good problem solving and data structure questions for hiring a fresh programmer.
Possible Duplicate:
Algorithm/Data Structure Design Interview Questions
Share some of good problem solving and data structure questions for hiring a fresh programmer.
My favorite is known as "FizzBuzz":
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.
How would you print out the data in a binary tree, level by level, starting at the top?
For a much more involved exercise, and for candidates already familiar with one or more higher-level language (such as C++ vector
or Python list
), try implement Sieve of Eratosthenes.
I ask if the candidate can explain how a list works internally (for example java.util.ArrayList) and how a hash table works internally (for example java.util.HashMap). If they don't know, at least they should know the performance characteristics, and what a hash code is.
Provide a solution to the following problem: Given task T and integer NumSeconds, Call T in NumSeconds.
Hint: The candidate will need to implement a data structure that will allow adding tasks and a write a procedure that queries the data structure and calls the matching task(s)