USA | Verily Life Sciences Technical Phone
Summary
I completed a technical phone screen with Verily Life Sciences where I was asked to simplify an arithmetic expression, handling parentheses and negation, and discussed my thought process with the interviewer.
Full Experience
Completed technical phone screen with Verily Life Sciences. Got asked this problem
Question
Given an arithmetic expression like a-(b+c) return a simplified expression.
Examples:
a-(b+c)givesa-b-ca+(a+b)givesa+a+b
Requirements:
- Variables are single letter. Don't worry about subscripts. Keep it simple
- Operations are only addition and subtraction. No worries about multiplication and division
- Followup: in math, you combine like terms when simplifying an expression. Modify your implementation to support that
Reflection
- Talked out my thought process and interviewer was very collaborative
- I think I got a much better handle on the recursion after solving "decoding an encoding" in a different interview
- Had a bit of trouble handling the open parentheses case and "combining the results" while accounting for negation. Interviewer gave me hint here and I was able to run with it
- Started with simple cases and then stress tested with other edge case. Interviewer liked my progress so far
Interview Questions (1)
Simplify Arithmetic Expression
Given an arithmetic expression like a-(b+c) return a simplified expression.
Examples:
a-(b+c)givesa-b-ca+(a+b)givesa+a+b
Requirements:
- Variables are single letter. Don't worry about subscripts. Keep it simple
- Operations are only addition and subtraction. No worries about multiplication and division
- Followup: in math, you combine like terms when simplifying an expression. Modify your implementation to support that