← Stripe Interview Insights

Stripe·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Did a debug round for Stripe's software engineer role. One bug in particular tripped me up more than it should have.

Questions Asked (1)

Q1

Given a YAML configuration file parsed with SnakeYAML, debug why the value for a boolean-like key is not being interpreted correctly.

Root Cause AnalysisTechnical Trade-offs
Author's notes

The bug was that 'flag: on' was being read as a boolean true instead of the string 'on'.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by reproducing the issue with a minimal YAML snippet and logging the parsed object to confirm the misinterpretation. Then systematically investigate SnakeYAML's type resolution rules, focusing on implicit resolvers and key quoting, and propose a fix that balances correctness with maintainability.

Pro tip: Mention that YAML 1.1 treats 'yes', 'no', 'on', 'off' as booleans, but SnakeYAML's default resolver may only handle 'true'/'false'—so the bug often lies in version mismatch or custom resolvers. Also, emphasize that quoting keys is a quick workaround but not a root-cause fix.

1. Reproduce and Isolate

Create a minimal YAML file and Java code that parses it with SnakeYAML, printing the resulting Map to confirm the incorrect boolean interpretation. Isolate whether the issue affects keys, values, or both.

2. Inspect SnakeYAML's Type Resolution

Review SnakeYAML's Resolver and implicit resolvers to understand how it maps plain scalars to types. Check if the key is being implicitly resolved as a boolean due to YAML 1.1 rules or custom resolver configuration.

3. Analyze YAML Specification and Library Version

Determine which YAML version SnakeYAML implements (1.1 by default) and compare with the YAML spec used by the config author. Check for version-specific differences in boolean-like tokens (e.g., 'yes', 'on').

4. Evaluate Fixes and Trade-offs

Consider solutions: quoting the key, using a custom Resolver to disable implicit boolean resolution, or upgrading/downgrading SnakeYAML. Discuss trade-offs like backward compatibility, config readability, and security implications.

5. Recommend and Validate

Propose the most appropriate fix, implement it, and add tests to prevent regression. Validate that the parsed value matches expectations and that other configs are unaffected.

Key Points to Mention

  • YAML 1.1 boolean-like tokens: yes/no, on/off, true/false (case variations)
  • SnakeYAML's default Resolver and how to customize it
  • Difference between quoted and unquoted keys in YAML
  • Impact of SnakeYAML version on type resolution (e.g., 1.x vs 2.x)
  • Security considerations: implicit type resolution can lead to unexpected behavior
  • Testing strategy: unit tests for YAML parsing with edge cases

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