KPMG interview question

Two Data structures coding questions