ShakeDeal interview question

JavaScript core questions.