Intercom Interview Question

Flood fill, streams manipulation, dichotomy search, etc...