Olympusat Interview Question

It was a scenario based and asked to code the test case