← Hudson River Trading Interview Insights
Start by clarifying the existing patterns for add and cancel operations, then map the modify operation onto those patterns end-to-end. Walk through the client API, network protocol, server-side handling, and order book update, highlighting any differences and edge cases. Emphasize consistency with the codebase and discuss trade-offs where the modify semantics diverge from add/cancel.
Pro tip: Modify is often implemented as cancel-replace, but that can break order priority and introduce race conditions; explicitly discuss whether the exchange or internal system supports true modify semantics and how you'd handle partial modifications.
Ask questions to understand the modify operation's semantics (e.g., can price/quantity change? Is it cancel-replace or in-place?) and review how add/cancel are implemented across client, protocol, and server.
Extend the client interface and network message format to include a modify request, mirroring the structure of add/cancel messages. Consider versioning and backward compatibility.
Add a handler for modify messages that validates the request, locates the order, and updates the order book. Decide whether to treat it as cancel-replace or a true modify, and handle concurrency and consistency.
Cover scenarios like modifying a non-existent order, invalid parameters, partial fills, and race conditions with concurrent operations. Ensure proper error responses and logging.
Write unit and integration tests for the new operation, including failure cases. Verify that the modify operation behaves consistently with add/cancel and meets performance requirements.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.