One of the soultion given to interview (Backend test)