KPMG Interview Question

Two Data structures coding questions