Everpure Interview Question

it was a coding challenge