Interactive Brokers interview question

Advanced Java, SQL, Puzzles