Cerium Systems interview question

Gave one scenario and asked to write a code.