Infiny interview question

logical questions