Deloitte interview question

Asked to write code on one scenario based on trigger