
August 1, 2012. Knight Capital rolls out new trading code to eight servers, but one server still carries a retired routine called Power Peg, and a reused flag wakes it up. For 45 minutes that machine fires orders it was never meant to send, 4 million trades, and the firm loses 440 million dollars and nearly dies before lunch. Here is the same trap in miniature: in test mode the dead code fires real orders. Make test mode do nothing.
Repair this code
Repair the router so test mode places no orders (returns 0) instead of firing the reactivated Power Peg routine.
Steps
$ orders_to_send(100, 0)
100
$ orders_to_send(100, 1)
0
$ orders_to_send(250, 0)
250
Expected files
Allowed functions
None. Write every helper yourself.
Loading solutions...