Standard Chartered Bank interview question

Mostly based on previous work