PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Hudson

Implement Order Modification Feature

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a software engineering competency in modifying and extending a C++ client/server trading system, focusing on state management, input validation, API integration, and maintaining invariants for order lifecycle.

  • hard
  • Hudson
  • Coding & Algorithms
  • Software Engineer

Implement Order Modification Feature

Company: Hudson

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Onsite

You are given an existing C++ trading system with a client/server architecture. The current system already supports two request types: - `AddOrder(order_id, symbol, side, price, quantity)` - `CancelOrder(order_id)` The server keeps all active orders in memory, keyed by `order_id`. Add support for a new request: - `ModifyOrder(order_id, new_price, new_quantity)` Requirements: 1. If the order does not exist or has already been canceled, the modification must be rejected. 2. `symbol` and `side` cannot be changed by a modify request. 3. A successful modification updates only `price` and `quantity` for the existing order. 4. `new_price` and `new_quantity` must both be positive; otherwise reject the request. 5. The order must remain associated with the same `order_id` after modification. 6. Integrate the new request into the existing client/server flow in the same style as the existing add/cancel functionality. Implement the feature and explain what parts of the codebase you would inspect or reuse before making changes.

Quick Answer: This question evaluates a software engineering competency in modifying and extending a C++ client/server trading system, focusing on state management, input validation, API integration, and maintaining invariants for order lifecycle.

Related Interview Questions

  • Solve Watcher Simulation And Integer Conversion - Hudson (medium)
  • Count People Reaching the Boundary - Hudson (easy)
  • Implement Buffer Parsers and Generic Map Class - Hudson (medium)
  • Count inversions in a permutation - Hudson (medium)
  • Count players reaching end with moving watchers - Hudson (easy)
Hudson logo
Hudson
Mar 13, 2026, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
7
0

You are given an existing C++ trading system with a client/server architecture. The current system already supports two request types:

  • AddOrder(order_id, symbol, side, price, quantity)
  • CancelOrder(order_id)

The server keeps all active orders in memory, keyed by order_id.

Add support for a new request:

  • ModifyOrder(order_id, new_price, new_quantity)

Requirements:

  1. If the order does not exist or has already been canceled, the modification must be rejected.
  2. symbol and side cannot be changed by a modify request.
  3. A successful modification updates only price and quantity for the existing order.
  4. new_price and new_quantity must both be positive; otherwise reject the request.
  5. The order must remain associated with the same order_id after modification.
  6. Integrate the new request into the existing client/server flow in the same style as the existing add/cancel functionality.

Implement the feature and explain what parts of the codebase you would inspect or reuse before making changes.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Hudson•More Software Engineer•Hudson Software Engineer•Hudson Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.