TechGig interview question

Coding challenge to solve two problems