Domanda di colloquio di IBM

Explain in which scenario you would write certain code?