Paintzen interview question

3 JavaScript algorithm questions of various difficulty.