Randstad US Interview Question

1. Explain the algorithm that I coded.