Alarm.com interview question

Debug code