InterviewDB Experience

Four Digits: Find All Valid Arithmetic Expressions from Four Single Digits

Interview Experience

Problem Given four single-digit integers, insert +, -, *, / between them (in any order, using each digit exactly once) to reach a target value. Return all distinct valid expressions. You may also use parentheses to change evaluation order. Example Follow-ups How many distinct expression trees are possible with 4 operands and 4 operators? Enumerate the cases. How do you handle division by zero safely? For which sets of 4 digits is it impossible to reach 24? How does complexity scale if extended t…

Full Details

🔒

Unlock all Shopify 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 shopify interview.

It covers the following topics: Coding, Pair Programming, Strings .