Coding Test - C++
Coding Test - C++
Detailed Requirements:
The order book is a dynamic record of all buy and sell orders
for a particular financial instrument.
Your program should maintain an order book with two main
components:
Buy Orders: Orders to purchase the instrument at a
specified price or better.
Sell Orders: Orders to sell the instrument at a specified
price or better.
Each order in the book should have the following attributes:
Order ID
Type (Buy/Sell)
Quantity
Price
Status (Pending, Executed)
Coding Task:
1. Input:
2. Output:
3. Implementation Details:
Example:
Input:
Pending Orders:
Order 1: Buy Limit, Price: 100, Quantity: 10
Order 2: Sell Limit, Price: 105, Quantity: 5
Order 3: Buy Stop, Price: 102, Quantity: 15
Order 4: Sell Stop, Price: 98, Quantity: 10
Ticks:
[Time: 09:00, Price: 101]
[Time: 09:01, Price: 100]
[Time: 09:02, Price: 106]
[Time: 09:03, Price: 97]
Output:
Explanation:
At 09:01, the price is 100, triggering the execution of the Buy Limit
order (Order 1).
At 09:02, the price is 106, triggering the execution of the Sell Limit
order (Order 2) and Buy Stop order (Order 3).
At 09:03, the price is 97, triggering the execution of the Sell Stop
order (Order 4).
Submission:
Additional Information
This coding test aims to evaluate your understanding and implementation
skills in: