DRW interview question

Three coding questions: array related