Software Engineer • Staff-Level
Software Engineer • Staff-Level
High QualityPrep Other Coding Questions Asked by Reddit
Continue with targeted prep from Reddit's coding question bank.
Interview Summary
The interview problem involved designing and implementing a tennis match scoring system using object-oriented programming.
Interview Details
Coding — Design a Tennis Match Scoring System
The interviewer presented a multi-part object-oriented design problem involving tennis match scoring. I needed to model how players earn points, win games, complete sets, and eventually win an entire match.
The exercise was divided into several stages, with additional requirements introduced as the implementation progressed. The first three parts covered the core scoring functionality, while the later parts tested whether the design could support additional features without major restructuring.
Part 1 — Implement Tennis Game Scoring
The first task was to implement a class representing a single tennis game between two players. Each player earns points according to the standard tennis scoring sequence:
- 0 (Love)
- 15
- 30
- 40
- Game
A player normally wins a game after earning at least four points and leading by two. However, when the score reaches 40-40, the game enters deuce, and one player must establish a two-point lead to win.
The interviewer expected the implementation to support recording a point for a particular player and retrieving the current game score. The deuce and advantage rules were particularly important. For example, if Player A wins a point at deuce, the
Unlock Full Details
Create a free account to unlock this interview experience report.