This is a real, in-use example from our codebase that regularly sees edits... or at least it was at one point in time. It contains some known flaws and less than optimal patterns. It could really use a good refactoring. How would you improve this code? What would you do differently? How would you test this sample? What else would you need to test?
- A source control repo of your preference containing incremental commits.
- Starting with the sample code prior to your refactor.
- Whatever tests make sense to support the original and your refactor, assuming there is no test coverage currently.
- Explanations of why you made the refactors that you did and what you omitted and why.
We'll conduct a mock code review to discuss your proposed refactor. Explain your reasoning, the strategies you employed, and the tradeoffs you considered. There are lots of opportunities for improvement, possibly more than anyone could tackle in the time allotted, and there are pieces of context missing from the example. Such is life.
Rather than grading you on your level of completion, this exercise is designed to:
- Provide a real-world example of what kind of work you can accomplish, not a contrived algorithmic example or toy project from scratch.
- Judge how you deal with ambiguity, missing context, and balancing tradeoffs and your experience with making incremental progress.
- Provide you a glimpse of some of the real work inside the codebase.
- Help us understand the technical value you can bring to the team.