← Stripe Interview Insights

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

Intermediate
May 2026

Summary

Stripe coding round where they hand you a broken codebase and tell you to fix it. The whole thing is built around a Python templating library called Mako, and you're working from failing tests rather than a blank slate.

Questions Asked (1)

Q1

You're given an existing codebase that uses the Mako Python templating library along with a set of failing tests. Find the bugs causing the failures and fix the code until all tests pass. Walk through your debugging process as you go.

Root Cause AnalysisTechnical Trade-offs
Author's notes

This format threw me a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by running the failing tests to see the exact errors, then trace each failure to its root cause in the Mako templates or Python code. Fix one bug at a time, re-running tests to confirm the fix and avoid introducing regressions. Finally, explain your reasoning and any trade-offs you considered.

Pro tip: Narrate your debugging process clearly, including hypotheses you test and discard, as this demonstrates structured problem-solving. Also, mention how you'd prevent similar bugs in the future (e.g., adding tests, improving error handling).

1. Reproduce and Understand Failures

Run the test suite to see which tests fail and capture the exact error messages and stack traces. Read the test code to understand what behavior is expected.

2. Isolate and Diagnose

For each failure, isolate the relevant template or code section and form a hypothesis about the root cause. Use debugging tools or print statements to inspect variables and template rendering.

3. Fix and Verify

Implement a minimal fix for the identified bug, then re-run the specific test to confirm it passes. Repeat for each failure, ensuring fixes don't break other tests.

4. Refactor and Harden

After all tests pass, review the fixes for code quality and consider edge cases. Add additional tests if needed to cover the fixed scenarios.

5. Communicate and Reflect

Summarize the bugs found, the fixes applied, and any trade-offs made. Discuss how you would prevent similar issues in the future.

Key Points to Mention

  • Mako template syntax and common pitfalls (e.g., variable escaping, inheritance, includes)
  • Debugging techniques: reading stack traces, using breakpoints, logging
  • Root cause analysis: distinguishing between symptoms and underlying causes
  • Test-driven debugging: using failing tests as specifications
  • Trade-offs: quick fix vs. proper solution, potential side effects
  • Preventive measures: adding regression tests, improving error messages, code reviews

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