Amazon.com

www.amazon.com
Employer Engaged

Interview Question

Software Development Engineer Intern Interview

Given a mathematical expression, what data structure would

  you use to evaluate the expression? How would you design the above question to use Trees/Graphs.
Answer

Interview Answer

1 Answer

0

Mathematical expression:
Use a stack and parse the expression into postfix onto the stack

Designing the question to use trees/graphs:
"Given a subway map, what data structure would you use to find the fastest route between two stations"

Anonymous on Nov 15, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.