NITS interview question

Do a test case.