Reported interview periodNov 2025–Sep 2026
Revenue Tracking with Direct Referrals
Build a customer revenue index. Each inserted customer has personal revenue and may name an existing customer as a referrer. A customer's total revenue is personal revenue plus the personal revenue of direct re…
Practice focusRequirements - Assign IDs starting at 0 in insertion order. - If a referrer is provided, update that customer's total by the new customer's personal revenue. - A customer's referrals do not contribute to its referrer's total; attribution is one level only. - The query considers totals at least min total revenue , orders by (total revenue, id) , and returns at most k IDs. - Validate non-negative revenue, valid referrers, and non-negative k .…