Crypto Trading System Stream
Coinbase interview questions · Medium · Coding round · 6 tests
Design an in-memory crypto trading order manager. Orders arrive as a stream, remain live until
cancelled, and can transition between ACTIVE and PAUSED.
Interface
class CryptoOrderSystem {
place(orderId: string, userId: string, currency: string, amount: number, price: number): void;
pause(orderId: string): boolean;
resume(orderId: string): boolean;
cancel(orderId: string): boolean;
cancelAllByUser(userId: string): number;
displayAllLiveOrders(): string[];
}Run your code with Ctrl+Enter to see results.