Brain Station-23 interview question

Basic algorithm, data structure, database