Mindojo Interview Question

Basic backend questions, an easy algorithmic task