Zynga interview question

Asked to solve problems while sharing the code and talking through it.