Thomson Reuters Interview Question

Basic coding questions on OOPS and two programs were given to solve.