Apex FizzBuzz
Celebrating FizzBuzz
years of FizzBuzz by adding a sampler of FizzBuzz testing problems for interview usage.
If you're planning to use Apex Fizz Buzz for interviews, my recommendation would be to:
- Start off by introducing the candidate(s) to
DefaultFizzBuzzTest
. Get them familiar with the layout of the language and the testing framework- Specifically call out the
IFuzzBuzz
interface. Use this to drive out the conversation about interfaces, how they differ from abstract/virtual classes, and why you might use one over the other(s)
- Specifically call out the
- Reveal
DefaultFizzBuzz
itself and have them work through the implementation - Work on refactoring (if possible) and how things like:
- coupling between the test and the implementation can be eased
- the tradeoffs introduced by tight/loose coupling
- how things like single returns / early returns influence the readability of the code
- etc ...
- Extra credit - work through another custom implementation! Check out
CustomFizzBuzz
and its test class - perhaps even have the candidate(s) come up with their own zany FizzBuzz-adjacent ideas and pair on implementing that.