← Stripe Interview Insights

Stripe·Software Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
Apr 2026

Summary

Stripe debugging round where you're handed a broken fork of the Mako Python template engine and told to find the bug. The final stretch goes into the compiler internals, which I was not expecting at all.

Questions Asked (3)

Q1

You're given a buggy fork of the Mako Python template engine. Investigate the failures, narrow down the root cause, and produce a fix.

Root Cause AnalysisTechnical Trade-offs
Author's notes

The setup sounds reasonable until you're actually in it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by reproducing the failures with minimal test cases to understand the symptoms, then systematically narrow down the root cause using debugging tools and code inspection. Once identified, implement a targeted fix and validate it with regression tests to ensure no new issues arise.

Pro tip: Demonstrate a methodical approach by documenting each step of your investigation, including hypotheses and how you tested them. This shows maturity and makes your reasoning transparent to the interviewer.

1. Reproduce and Characterize Failures

Run the provided test suite or create minimal examples to consistently reproduce the failures. Document the exact error messages, stack traces, and conditions under which they occur.

2. Isolate the Faulty Component

Use debugging techniques (e.g., print statements, debugger, bisecting) to narrow down which part of the Mako engine is causing the issue. Compare with the original Mako code to spot deviations.

3. Identify Root Cause

Analyze the isolated code to determine the underlying bug, such as a logic error, incorrect variable scope, or mishandled edge case. Explain why it causes the observed failures.

4. Implement and Test Fix

Write a minimal fix that addresses the root cause without introducing side effects. Add or update tests to cover the bug and ensure all existing tests pass.

5. Validate and Reflect

Run the full test suite and any additional edge cases to confirm the fix. Discuss potential trade-offs of your solution and alternative approaches.

Key Points to Mention

  • Systematic debugging methodology (reproduce, isolate, fix, verify)
  • Understanding of Mako template engine internals (compilation, rendering, context handling)
  • Use of version control (e.g., git bisect) to identify the buggy commit
  • Writing regression tests to prevent future occurrences
  • Considering edge cases and potential side effects of the fix
  • Communicating findings clearly and justifying the chosen solution

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

Q2

In the template compiler path, a tag is missing or not being recognized, causing compilation to fail. Trace the lexer and parser flow, identify where the tag should be registered or emitted, and patch it.

Root Cause AnalysisSystem Design
Author's notes

This was the part that genuinely surprised me.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by reproducing the failure with a minimal template and enabling debug/trace logs to pinpoint where the tag is dropped. Then walk the lexer and parser flow to identify the missing registration or emission point, and patch it with a test to prevent regression.

Pro tip: Before diving into code, check if the tag is a known keyword or custom directive—often the fix is as simple as adding it to the lexer's keyword map or parser's tag registry. Also, ensure the patch handles edge cases like nested tags or attributes.

1. Reproduce and Isolate

Create a minimal template that triggers the failure and confirm the error. Use debug flags or logging to see the token stream and parse tree.

2. Trace Lexer Flow

Examine how the lexer tokenizes the template. Check if the tag is recognized as a valid token type; if not, identify where tag names are matched (e.g., regex, keyword list) and add the missing tag.

3. Trace Parser Flow

Follow the parser's handling of tokens. Verify if the parser expects the tag to be emitted by the lexer or registered in a tag handler map. If missing, add the tag to the appropriate registry or emission logic.

4. Patch and Validate

Implement the fix at the identified point, ensuring it integrates with existing tag handling. Add unit tests for the tag in isolation and integration tests with the full compiler.

5. Verify and Document

Run the full test suite to ensure no regressions. Document the change and update any relevant tag lists or documentation.

Key Points to Mention

  • Lexer tokenization: how tags are recognized (e.g., regex patterns, keyword lists)
  • Parser tag registration: mapping of tag names to handlers or AST nodes
  • Error handling and debug logging to trace missing tokens
  • Test-driven approach: writing a failing test first, then fixing
  • Edge cases: nested tags, attributes, self-closing tags
  • Impact on other parts of the compiler (e.g., code generation, source maps)

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

Q3

How would you write a regression test for the fix you just made, and how could this bug have been caught earlier?

Technical Trade-offsRoot Cause Analysis
Author's notes

Easier to talk through than the debugging itself.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by describing the regression test you would write, focusing on reproducing the exact bug scenario and asserting the correct behavior. Then analyze the root cause and identify gaps in testing, code review, or monitoring that allowed the bug to slip through. Conclude with concrete preventive measures to avoid similar issues in the future.

Pro tip: Emphasize writing a test that fails without the fix and passes with it, and mention adding a comment linking the test to the bug report for traceability. Also, discuss how you would share the root cause analysis with the team to improve processes.

1. Understand the bug and fix

Briefly restate the bug, its impact, and the fix you implemented to ensure clarity and context.

2. Design the regression test

Outline a test that reproduces the bug, including setup, execution, and assertions. Mention the test level (unit, integration, etc.) and why it's appropriate.

3. Perform root cause analysis

Explain why the bug occurred and why existing tests didn't catch it. Consider factors like edge cases, test coverage, and assumptions.

4. Propose preventive measures

Suggest improvements to testing, code review, monitoring, or development practices to catch similar bugs earlier.

5. Summarize and reflect

Conclude with key takeaways and how you would apply these lessons to future work.

Key Points to Mention

  • Test should fail before fix and pass after (red-green testing)
  • Choose appropriate test level (unit, integration, end-to-end) based on bug nature
  • Root cause: missing edge case, incorrect assumption, or inadequate test coverage
  • Improve test coverage for similar scenarios (e.g., boundary conditions, error handling)
  • Enhance code review checklists or pair programming to catch logic errors
  • Add monitoring/alerting for early detection in production
  • Document the bug and fix in test comments or commit messages for traceability

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