Randstad US interview question

Standard question, in personal interview client asked to write algorithm and sql statements.