In Time Tec Interview Question

Few puzzle questions and basic coding