InterviewDB Experience · New York

Variable Expansion: Implement Shell-Style Variable Substitution in a Template String

Interview Experience

Problem Implement a function that expands ${VARIABLE} placeholders in a template string using a provided variable map. Undefined variables should raise an error. Nested expansions (a variable whose value contains another ${...}) should be recursively resolved up to a max depth. Example: Follow-ups How do you detect cycles in variable expansion, and what error do you raise? How would you support default values with ${VAR:-default} syntax (similar to bash)? What is the difference between eager exp…

Full Details

🔒

Unlock all Rubrik 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 rubrik interview during the phone round.

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