P.C. Richard & Son interview question

Debug Javascript code and SQL