Konverge.AI interview question

Algorithms for the codes written