LTIMindtree interview question

How do you handle NoSuchElementException