All On Block interview question

Basic algorithm questions and few puzzles