← The Trade Desk Interview Insights

The Trade Desk·Software Engineer·Onsite - Coding / Algorithms·Intermediate

IntermediatePrefer not to say
Apr 2026

Summary

Coding round for a software engineer role at Tradedesk. The question was domain-specific rather than algorithm-style, and I fumbled it pretty badly.

Questions Asked (1)

Q1

Implement a bowling score calculator. You define the input format yourself and need to handle all the edge cases: a strike adds the next two balls to that frame's score, and the 10th frame allows up to three balls.

Algorithms & Data Structures
Author's notes

I underestimated this one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the input format and edge cases with the interviewer, then outline a frame-by-frame scoring algorithm that handles strikes, spares, and the 10th frame's bonus balls. Implement the solution with clear variable names and test it against known cases like a perfect game (300) and all spares (150).

Pro tip: Mention that you'll write unit tests for edge cases (e.g., all strikes, all spares, gutter balls) before coding, and use a simple list of rolls with index tracking to avoid complex frame objects—this shows test-driven thinking and simplicity.

1. Clarify requirements and input format

Ask the interviewer about the input representation (e.g., list of rolls, string of symbols) and confirm scoring rules for strikes, spares, and the 10th frame. This ensures alignment and avoids assumptions.

2. Design the algorithm

Outline a frame-by-frame approach: iterate through rolls, and for each frame, compute the score based on whether it's a strike, spare, or open frame. Handle the 10th frame separately with up to three rolls.

3. Implement the solution

Write clean code using a list of rolls and an index to track position. Use helper functions or conditionals to add bonus points for strikes and spares, ensuring the 10th frame logic is correct.

4. Test with edge cases

Run through test cases: perfect game (12 strikes = 300), all spares with a final 5 (150), all gutter balls (0), and a mix including a spare in the 10th. Verify outputs match expected scores.

5. Discuss complexity and improvements

State that the solution is O(n) time and O(1) extra space (if using a list of rolls, O(n) space). Mention potential extensions like validating input or supporting different input formats.

Key Points to Mention

  • Input format: list of integers representing pins knocked down per roll (e.g., [10, 7, 3, ...]).
  • Strike scoring: 10 + next two rolls; spare scoring: 10 + next one roll.
  • 10th frame: if strike or spare, get bonus rolls (up to three total).
  • Edge cases: perfect game (300), all spares (150), gutter balls (0), and incomplete frames.
  • Algorithm complexity: O(n) time, O(1) extra space if processing rolls on the fly.
  • Testing: use known scores to validate implementation.

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