ZS Associates interview question

Test cases for white board.