Goldman Sachs Interview Question

he asked me to write the syntax for the trigger