← Otter.ai Interview Insights

Otter.ai·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Interviewed for a Software Engineer role at OtterAI and ran into a follow-up problem I just couldn't finish in time. Ended up submitting pseudo code, which never feels great.

Questions Asked (1)

Q1

Implement a basic calculator that supports +, -, *, /, parentheses, and nested expressions (LeetCode 772 style).

Algorithms & Data Structures
Author's notes

This was a follow-up to whatever came before it and I ran out of time.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Use a recursive descent parser or a stack-based approach to handle operator precedence and parentheses. For recursive descent, define functions for expression, term, and factor, where expression handles addition/subtraction, term handles multiplication/division, and factor handles numbers and parenthesized expressions. For stack-based, use two stacks: one for numbers and one for operators, and process the string with precedence rules.

Pro tip: Clarify with the interviewer whether the expression is guaranteed to be valid and whether division is integer or floating-point. Also, mention that you can handle unary minus and spaces if needed, showing attention to edge cases.

1. Clarify requirements and edge cases

Ask about input format, validity, division behavior, and whether unary operators or spaces are present. This ensures you build the correct solution.

2. Choose an approach

Decide between recursive descent parsing (clean, extensible) or stack-based evaluation (iterative, no recursion). Explain your choice based on clarity and efficiency.

3. Outline the algorithm

For recursive descent, describe the grammar and the three functions. For stack-based, describe how to push numbers and operators, and when to pop and evaluate.

4. Walk through an example

Trace through a nested expression like '2*(3+4/2)' to demonstrate how your algorithm handles precedence and parentheses.

5. Analyze complexity and discuss optimizations

State time and space complexity (O(n) time, O(n) space for stack or recursion depth). Mention potential optimizations like handling unary minus or using a single stack.

Key Points to Mention

  • Operator precedence: multiplication and division before addition and subtraction.
  • Handling parentheses and nested expressions recursively or with a stack.
  • Use of two stacks (numbers and operators) in the stack-based approach.
  • Recursive descent parsing with functions for expression, term, and factor.
  • Time and space complexity: O(n) time, O(n) space due to stack or recursion depth.
  • Edge cases: division by zero, unary minus, spaces, and invalid expressions.

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