Block Interview Question

first round is all algorithm