Microchip Technology Interview Question

Share case and solution for it