Design a Customer Revenue Index with Referrals and Threshold Queries
Last updated: August 24, 2026
Quick Overview
Design a system that manages customer revenue data while supporting referral tracking and querying for the lowest revenue customers above a specified threshold.
Databricks
August 24, 20266
0
98 solved
Design a system that manages customer revenue data while supporting referral tracking and querying for the lowest revenue customers above a specified threshold.
This question is typically asked in the technical screen round to evaluate a candidate's ability to design a scalable and efficient system. The interviewer is looking for a clear understanding of data structures, algorithms, and the ability to handle real-world scenarios involving customer data management and queries.
What the Interviewer Expects
- Explain the requirements and functionalities of the system clearly.
- Discuss the choice of data structures and algorithms for efficiency.
- Provide a high-level design of the system architecture.
- Detail the implementation of the key functions, especially focusing on performance.
- Address potential trade-offs and scaling considerations.
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- How would you handle concurrent inserts and queries?
- What would you do if the revenue data grows significantly?
- Can you explain how you would test the system for edge cases?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
The system must support three main functions:
insert(revenue)- inserts a new customer with an auto-incremented ID.insert(revenue, referrer)- inserts a new customer with a specified refe...
High-Level Design
To implement this system, we can use a combination of a hash map and a sorted data structure. The hash map will store customer data, including their revenue and referrer information. For the `get_lowe...