Salesforce interview question

Questions based on array manipulations