Amazon interview question

Program debugging and pattern matching.