X interview question

Two coding challenges and one design question