← Tradedesk Interview Insights

Tradedesk·Software Engineer·Onsite - Coding / Algorithms·Intermediate

IntermediatePrefer not to say
May 2026

Summary

Coding round for a software engineer role at Tradedesk. The question was a bowling score calculator, and I fumbled it pretty badly since it wasn't the typical LeetCode format I'd been grinding.

Questions Asked (1)

Q1

Implement a bowling score calculator. You define your own input format and must handle all the scoring rules, including strikes (where the next two balls are added to the 10), and the special case of the 10th frame allowing up to three balls.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This was not a clean algorithmic puzzle with a neat answer.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the input format and scoring rules, then design a data structure to represent frames and rolls. Implement the scoring logic by iterating through frames, handling strikes and spares with lookahead, and special-casing the 10th frame. Test with edge cases like perfect games and all spares.

Pro tip: Discuss trade-offs between different input formats (e.g., list of rolls vs. list of frames) and how your choice affects simplicity and extensibility. Mention that you'd write unit tests for known scenarios to validate correctness.

1. Clarify requirements and define input format

Ask clarifying questions about the expected input (e.g., array of rolls or frames) and output. Propose a simple, unambiguous format like an array of integers representing pins knocked down per roll.

2. Design data structures and scoring algorithm

Outline how to represent frames and rolls, and describe the algorithm: iterate through rolls, accumulate scores, and apply strike/spare bonuses using lookahead. Handle the 10th frame separately.

3. Implement core scoring logic

Write pseudocode or actual code for the main loop, ensuring correct handling of strikes (next two rolls) and spares (next roll). For the 10th frame, allow up to three rolls if a strike or spare occurs.

4. Test with edge cases

Validate the solution with cases like perfect game (12 strikes), all spares with a final 5, gutter game, and mixed frames. Explain how you'd debug any discrepancies.

5. Discuss trade-offs and optimizations

Mention alternative approaches (e.g., frame-based vs. roll-based) and their pros/cons. Consider time/space complexity and potential for code reuse.

Key Points to Mention

  • Input format choice: array of rolls vs. array of frames, and why one might be simpler.
  • Strike scoring: 10 + next two rolls; spare scoring: 10 + next roll.
  • 10th frame special rules: up to three rolls if strike or spare.
  • Edge cases: perfect game, all spares, gutter game, and incomplete frames.
  • Testing strategy: unit tests for known scenarios and boundary conditions.
  • Time and space complexity: O(n) time, O(1) extra space if using roll array.

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