Cirrus Logic OA 2019

Q1 - FizzBuzz

Q2 - Word/Stack Machine

POP : Pop the elements from the stack.
DUP : Duplicates top element, makes a copy of it and places it at the top of the stack.
+ : Pops top two elements, adds them and places the sum to top of the stack.
- : Same like + except it subtracts top element with second top element.

Q3 -
image

Solution for Q3 -