The tennis question.
Part 1: write Game. I think you should also talk through the input / output format with the interviewer, because none was given. Functions like get score, record score, and get winner, plus error case handling.
Part 2: write Set, with pretty much the same functions.
Part 3: the interviewer said Game's get score function should pretty print, something like 0 / 15 / 30 / 40 / deuce / adv-A / adv-B.
I ran out of time on this part and didn't finish it.
Discussion
Loading comments…