Nice interview question

Basic javascript, API, and SQL questions.