Citadel Securities Interview Question

How can you solve this arrangement puzzle?