Google Interview Question

I was requested to write some code on a board