Virtu Financial interview question

Some coding questions. Usually can be solved by some undergraduate algorithm knowledge.