tado° interview question

Basic problem solving with examples how to implement that.