Veveo interview question

1 question was based on Dutch National Flag Problem