Yahoo interview question

Same old computer science fundamentals.