Customer Creation Query
Problem Statement
Designing a Customer Management System that supports creation of customers, revenue tracking, and referrals. The system should allow the company to track revenue generated by each customer and support referral logic where referring customers receive the referred customer's revenue added to their own.
🎯 Functional Requirements
You need to implement the following operations:
Adds a new customer to the system with the given revenue.
Each customer must be assigned a unique ID (auto-increment or UUID).
No referral is involved in this call.
2.addCustomer(double revenue, string referredById)
Adds a new customer with the given revenue, and links it to an existing customer using referredById.
The referred customer’s revenue should increase by the revenue of the new customer.
3.getKCustomersWithRevenueGreaterThanValue(int k, double value)
Returns the IDs of the first k customers whose revenue is greater than the specified value.
“First k” means based on insertion order, not sorted by revenue.
If fewer than k customers qualify, return all matching.