Tally Solutions interview question

Basic DSA, and CS Fundamentals