Mphasis Interview Question

they gave us coding to crack