Taction Software interview question

reasoning