Debug
This is a debugging assessment where you'll identify and fix bugs in a Python template library codebase. You'll receive access to a GitHub repository containing a modified version of the Mako template engine with intentionally introduced bugs. Your task is to find and explain these bugs using the test suite and your debugging skills.
The exercise tests your ability to navigate an unfamiliar codebase, understand complex code quickly, use debugging tools effectively, and communicate your thought process clearly.
Repository: Google Drive
Duration: Approximately 45-60 minutes
Environment: Clone the provided repository, work locally, share screen
Language: Python
Interaction: The interviewer observes your debugging process -- think aloud as you work
Mako is a widely-used Python template library that compiles templates into Python modules for high performance. Key features include:
Embedded Python: Templates can contain Python code blocks using <% ... %> syntax
Variable Interpolation: Use $${variable} to insert values into templates
Template Inheritance: Templates can extend base templates using <%inherit>
Reusable Components: Define template functions with <%def> tags
Control Flow: Standard Python constructs like loops and conditionals work directly
` <%inherit file="base.html"/>
<%def name="greeting(name)"> Hello, ${name}! </%def>
% for item in items: <li>${item}</li> % endfor `
You don't need prior experience with Mako -- the codebase includes comprehensive tests that will help you identify what's broken.
Clone the repository and navigate to the debug-mako directory
Install dependencies: pip install -r bugsquash-requirements.txt
Run the test suite: python -m pytest test/
Observe which tests fail and begin your investigation
The repository contains a full template library implementation: