InterviewDB Experience

String Template Parser: Parse and Render Templates with Variable Substitution and Conditionals

Interview Experience

Problem Implement a minimal string template engine. Templates may contain: Variable substitution: {{variable_name}} Conditionals: {{#if condition}}...{{/if}} Loops: {{#each items}}...{{item}}...{{/each}} Follow-ups How do you handle nested {{#if}} inside {{#each}}? Describe your parsing approach (recursive descent vs regex). What happens if context is missing a key referenced in the template? Silent empty string or error? Sanitize output against XSS: if name = "<script>alert(1)</script>", what s…

Full Details

🔒

Unlock all Figma questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a candidate experience report from a figma interview during the phone round.

It covers the following topics: Strings, Phone, Recursion, Coding, Onsite .