Grazitti Interactive interview question

Logical Approach towards any problem