Amdocs Interview Question

thinking process explain the things I did