Microchip Technology interview question

Intermediate+ complex Round