← Airbnb Interview InsightsMachine Learning Engineer

Airbnb·Machine Learning Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
Apr 2026

Summary

Coding round at Airbnb for an ML Engineer role. The problem was a bowling score calculator, which sounds straightforward until you actually try to handle the 10th frame edge cases cleanly.

Questions Asked (1)

Q1

Given a sequence of rolls in a 10-frame bowling game, compute the total score following standard bowling rules including strike and spare bonuses and the 10th frame's extra rolls.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The core logic isn't bad but I kept second-guessing the 10th frame.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the input format (e.g., list of rolls or per-frame rolls) and confirm edge cases like all strikes or spares. Then walk through a frame-by-frame scoring algorithm, explaining how to handle strike/spare bonuses and the special 10th frame, and finally analyze time/space complexity and potential optimizations.

Pro tip: Emphasize that the algorithm should process rolls in a single pass, using a pointer to track the current roll and frame, which avoids unnecessary storage and demonstrates efficient thinking. Also, mention that you would test with edge cases like a perfect game (12 strikes) to ensure correctness.

1. Clarify Input and Output

Ask whether the input is a list of all rolls or a list of frames, and confirm that the output is the total score. Clarify any assumptions about valid inputs.

2. Define Scoring Rules

Restate the standard bowling scoring: strike = 10 + next two rolls, spare = 10 + next one roll, open frame = sum of pins. Note the 10th frame allows up to three rolls if strike or spare.

3. Design Algorithm

Use a single pass with an index i over the rolls. For each frame (1 to 9), if strike, add 10 + rolls[i+1] + rolls[i+2] and i += 1; if spare, add 10 + rolls[i+2] and i += 2; else add rolls[i] + rolls[i+1] and i += 2. For the 10th frame, sum the remaining rolls (up to 3) without bonus.

4. Handle Edge Cases

Consider cases like all strikes (12 rolls), all spares (21 rolls), and incomplete games. Ensure the algorithm correctly handles the 10th frame's extra rolls and does not access out-of-bounds indices.

5. Analyze Complexity and Optimize

State that time complexity is O(n) where n is number of rolls (max 21), and space is O(1) extra. Discuss potential optimizations like early termination or using a frame-based approach if input is per-frame.

Key Points to Mention

  • Strike bonus: next two rolls; Spare bonus: next one roll
  • 10th frame special rules: up to three rolls if strike or spare
  • Single-pass algorithm with index tracking to avoid extra space
  • Edge cases: perfect game (12 strikes), all spares (21 rolls), gutter game
  • Time complexity O(n) and space O(1)
  • Input format clarification: list of rolls vs. list of frames

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