TPP interview question

Marble logic question