Mouser Electronics Interview Question

coding questions were asked to me