Amdocs Interview Question

There were 4 questions in interview and with regular competitive coding, one can clear it.