DSV leven interview question

code assignment and discussing it