Block interview question

Random pair programming problems. Nothing difficult.