Cisco interview question

Technical round 2, coding round 1