Distru Interview Question

Write an algorithm that can evaluate an equation written in reverse Polish notation.

Interview Answer

Anonymous

Apr 17, 2020

The interview was conducted via screen share instead of a shared coding environment. They will doc points if you need to look up any APIs so make sure to memorize them! I implemented a sliding window version that slid until a valid RPN equation is found and evaluated until 1 element remained in the array. However, I believe they were looking for something more simple so I recommend using a stack.

1