System Design: LinkedIn provides public APIs to access data on LinkedIn's platforms. Each API call is subject to a daily quota on a per company/per user basis. Design a system to enforce the quotas and collect API usage information. I defined the data model and used Redis with a replica to store the information about the remaining quota. I talked about how you could use an eventually consistent DB like DynamoDB in place of Redis, but you'd likely have too many people exceeding their quotas. If you use SQL in place of Redis, then it will be a bottleneck. Redis is pretty fast and serves as a happy medium between consistent and performant. We could tweak this based on data from instrumentation. Use CDC to have Redis write to a replica in case of failures. Push a message to Kafka after each write so that you can later analyze the API usage. The interviewer seemed slightly interested, but he didn't seem like he was asking the right questions about the system. He seemed to ask really easy questions about the happy path instead of what should happen if something fails, for example. ======== Coding 1: RetainBestCache. Make it thread safe and give an example of a race condition for each part of the code that you're putting in a lock. After the question, we discussed hypothetical approaches to managing data with dynamic rankings. ==================== Craftsmanship Round. Quality in the crafts. Outcomes matter. LinkedIn want engineers who are proud of their work and inspire their teams. Define a quality product/system. Talk about a time where you failed to show good craftsmanship and what you would've done better. Describe your strategy regarding code reviews. Talk about a project that had many junior engineers and how I kept their quality high. Talk about a time where you helped grow an engineers. If your team keeps growing and you get more junior engineers, what do you do? Hypothetical: Imagine you join LinkedIn on a massive team that owns a legacy application. The application lacks adequate testing and monitoring and has slow response times. Consumers complain about this. Deployment of the application often contains bugs. Rank the following in terms of priority: bugs, no testing, no monitoring, slowness What do you tackle first? How do you eventually turn this into micro services? What kind of signals do you look for when prioritizing bugs? Give examples of "P0" bugs. What do you look for when determining the success of a service? What are the pros and cons of microservices vs monoliths? ==================== Hiring Manager: Who am I and what do I do? Describe my day-to-day role. How big is my team? What is my tech stack? Talk about a project that had large scale. Answer specific follow up questions about the project. What project do I consider the most significant? What's the most challenging aspect of that project. Hypothetical: Suppose you join LinkedIn and you're asked to build a feature that sends suggested candidates to recruiters who have opened a new job profile. What's your overall approach? How do you organize the team? What's your rollout / deployment approach? ====================== Coding 2: Create a data structure that does the following: void addInterval(int start, int end) Must be O(log(n)). You must use a segment tree or interval tree. int getCoveredSize() Returns the total size covered by all the intervals. This one must be O(1) Combination Sum I No follow ups after this. 1 week later, I got a call from the recruiter saying that I failed the onsite. I asked him for feedback and he refused to say anything.
Rate limiter quotas - If they need to be exact, then you can't use Redis. Approximate quotas are ok with your approach. Look into concurrent rate limiter
The interviewer said it doesn’t have to be exact. That’s like the first thing I asked.
This is a good write up and would help many folks with their interview prep
Aren’t there two sys design rounds for staff level?
Op did they ask you to code in C++ / Java? Have a systems and infra loop and an interviewer insisted on it
What is the problem statement for RetainBestCache?
Isn’t your system design question just a generic rate limiter? Why not just go with an approach from one of these YouTube videos?
Because a lot of those suck. And I think my approach is pretty common. If you use a SQL database, you’ll have a bottleneck.
Did they not want you to focus on different rate limiting algorithms? Redis seems like the obvious answer to me with a persistent storage layer behind
I didn’t sign an NDA