TechSophy interview question

3 Puzzles, coding question and sql question.