ZS Associates Interview Question

Fairly straight forward.