← Questions
Order manager with partial cancellations and indexed queries
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Build an order manager driven by text commands. Create an order with an ID, a user ID, a UTC creation time and a quantity, validating each field and rejecting duplicate IDs. Cancel part of an order's quantity, any number of times, never more than remains; an order with nothing left is cancelled. Answer two queries: the IDs of active or of cancelled orders, and the IDs of orders created between two timestamps, both in creation order. Keep indexes so the queries stay fast as orders change state.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
