← Reddit Interview Insights

Reddit·Machine Learning Engineer·Technical Phone Screen·Senior

Senior
May 2026

Summary

This was a coding round for a Machine Learning Engineer role at Reddit, focused on object-oriented design for a tennis scoring system. The problem was split into progressive parts and required clean composition patterns and some careful thinking about state management across games.

Questions Asked (2)

Q1

Design a set-level scoring system for tennis that tracks multiple games, exposes methods to get the current set score and determine the set winner, and supports both simplified and standard scoring formats.

System DesignAPI & IntegrationsTechnical Trade-offs
Author's notes

The composition angle was the key thing here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scope, then design a class hierarchy that separates scoring rules from set management. Use the Strategy pattern to support both simplified and standard scoring formats, and expose clean methods for updating scores, retrieving the current set score, and determining the winner.

Pro tip: Emphasize extensibility and testability: design the system so new scoring formats can be added without modifying existing code, and discuss how you would unit test edge cases like deuce and tiebreaks.

1. Clarify Requirements

Ask about the specific rules for simplified and standard formats, including number of games, tiebreak conditions, and whether the set winner is determined by games or points. Confirm the expected API surface and any constraints.

2. Define Core Entities

Identify the main objects: Set, Game, and a ScoringStrategy interface. The Set manages a collection of Games and delegates point scoring to the strategy, which encapsulates the rules for a single game.

3. Design the API

Expose methods like `addPoint(player)`, `getCurrentSetScore()` returning a structured score (e.g., games per player, current game score), and `getSetWinner()` returning the winning player or null if not finished.

4. Implement Scoring Strategies

Create concrete strategies: SimplifiedScoring (e.g., first to 4 points, no deuce) and StandardScoring (e.g., 0,15,30,40, deuce, advantage). Each strategy handles point progression and determines when a game is won.

5. Handle Set Completion and Edge Cases

Define set-winning conditions (e.g., first to 6 games with 2-game lead, tiebreak at 6-6). Ensure the Set updates its state after each game and correctly reports the winner, including tiebreak scenarios.

Key Points to Mention

  • Strategy pattern to encapsulate scoring rules and enable easy addition of new formats
  • Separation of concerns: Set manages games, Game manages points via strategy
  • API design: clear methods for updating score, getting current score, and checking winner
  • Handling of deuce, advantage, and tiebreak in standard scoring
  • Immutability and thread-safety considerations if the system is concurrent
  • Unit testing edge cases like 6-6 tiebreak, deuce, and simplified scoring

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How do you ensure the game score resets correctly after each completed game, and that cross-game win counts accumulate properly across the set?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

They pushed on this specifically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the game's state model and the distinction between per-game score and cross-game win counts. Then describe a state management design that isolates mutable per-game data from persistent set-level data, and explain how you would test and validate the reset and accumulation logic.

Pro tip: Emphasize idempotency and atomicity: ensure that resetting a game's score is idempotent and that updating win counts is atomic to avoid race conditions or double-counting, especially in concurrent or distributed environments.

1. Clarify requirements and state model

Define what constitutes a 'game', a 'set', and how scores and win counts are represented. Identify all state variables and their lifecycles.

2. Design state separation

Propose a clear separation between per-game state (e.g., current score) and set-level state (e.g., win counts). Use distinct data structures or scopes to prevent accidental coupling.

3. Implement reset and accumulation logic

Describe how to reset per-game state at game end (e.g., via a reset function or event) and how to increment win counts based on game outcome. Ensure the order of operations is correct.

4. Handle edge cases and concurrency

Address scenarios like ties, abandoned games, or concurrent updates. Use locks, transactions, or idempotent operations to maintain consistency.

5. Test and validate

Outline unit and integration tests to verify that scores reset correctly and win counts accumulate as expected across multiple games and sets.

Key Points to Mention

  • State machine or lifecycle model for a game (start, play, end, reset)
  • Separation of concerns: per-game score vs. cross-game win counts
  • Idempotent reset operations to avoid double-resetting
  • Atomic updates or transactions for win count accumulation
  • Handling ties or incomplete games in win count logic
  • Testing strategies: unit tests for reset, integration tests for accumulation

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.