"Similar to LRU, Keep a Sorted LinkedList based on ranks. To improve efficiency of storage changed to PriorityQueue (minHeap). Later was asked about threading and how you can scale it in a distributed system"
Arjun R. - "Similar to LRU, Keep a Sorted LinkedList based on ranks. To improve efficiency of storage changed to PriorityQueue (minHeap). Later was asked about threading and how you can scale it in a distributed system"See full answer
"One good reason for using the doubly linked list is that to remove an accessed item in the list from its existing position say in the middle of the list and move it to the head, you need to update the previous node's next pointer and the next node's previous pointer. A singly linked list only has next pointers, so removing from the middle would require traversing from the head to find the previous node which requires O(n) time. A doubly linked list allows O(1) removal from any position because w"
Javed S. - "One good reason for using the doubly linked list is that to remove an accessed item in the list from its existing position say in the middle of the list and move it to the head, you need to update the previous node's next pointer and the next node's previous pointer. A singly linked list only has next pointers, so removing from the middle would require traversing from the head to find the previous node which requires O(n) time. A doubly linked list allows O(1) removal from any position because w"See full answer
"Designing a system to deny services to requests from banned IPs involves integrating real-time IP checking with your service architecture. Here’s a detailed outline of how you can design such a system:
System Design Overview
The goal is to ensure that your service can efficiently check incoming requests against a list of banned IPs and deny access when necessary. The system will leverage an external API, security.gov.x, to determine if an IP address is blocked or allowed.
**Key Compone"
Palak A. - "Designing a system to deny services to requests from banned IPs involves integrating real-time IP checking with your service architecture. Here’s a detailed outline of how you can design such a system:
System Design Overview
The goal is to ensure that your service can efficiently check incoming requests against a list of banned IPs and deny access when necessary. The system will leverage an external API, security.gov.x, to determine if an IP address is blocked or allowed.
**Key Compone"See full answer
"Step 1: Clarifying the Problem Scope
We will focus on designing the leaderboard for Dream11 with these assumptions:
Registered teams: 100,000 users are actively participating and ranked.
Real-time updates: Leaderboard updates frequently as players accumulate points based on live sports events.
Multiple leagues: Each user can participate in different leagues, so we will need to maintain a separate leaderboard for each league.
Query efficiency: Users frequently"
Ramendra S. - "Step 1: Clarifying the Problem Scope
We will focus on designing the leaderboard for Dream11 with these assumptions:
Registered teams: 100,000 users are actively participating and ranked.
Real-time updates: Leaderboard updates frequently as players accumulate points based on live sports events.
Multiple leagues: Each user can participate in different leagues, so we will need to maintain a separate leaderboard for each league.
Query efficiency: Users frequently"See full answer
"
To clarify on what we are trying to solve for and get the definition of a distributed scheduler straight . So A Distributed Scheduler refers to a system that can handle job scheduling and execution in a scalable and fault-tolerant manner by distributing the workload across multiple servers or nodes.
we will make some assumptions with the design , as follows:
we will assume 10,000 QPS for job submissions and should be able query for jobs status .
Job execution should have minimal latency"
Scott S. - "
To clarify on what we are trying to solve for and get the definition of a distributed scheduler straight . So A Distributed Scheduler refers to a system that can handle job scheduling and execution in a scalable and fault-tolerant manner by distributing the workload across multiple servers or nodes.
we will make some assumptions with the design , as follows:
we will assume 10,000 QPS for job submissions and should be able query for jobs status .
Job execution should have minimal latency"See full answer
"I tried solving this problem and here is the recorded video for the answer.
https://www.youtube.com/watch?v=d1tOkeQjyI4
And here is the link to Excalidraw board - https://excalidraw.com/#json=uabNFHcZm5qNh8CInMvyh,Wn9Vf1ZhGdl_iBCQYFkYdw"
Rjj - "I tried solving this problem and here is the recorded video for the answer.
https://www.youtube.com/watch?v=d1tOkeQjyI4
And here is the link to Excalidraw board - https://excalidraw.com/#json=uabNFHcZm5qNh8CInMvyh,Wn9Vf1ZhGdl_iBCQYFkYdw"See full answer
"
At low level:
I would use two stacks: one for forward history and other for backward history.
i go to tryexponent.com => this url will be stored in backward history stack.
i go to google => again this url will be stored in backward history stack.
i press back => data from backward history will be popped and put in to forward history stack.
I press forward => data from forward history stack will be popped and put in to backward history tab.
Also, whenever i go to any url,"
Anubhav S. - "
At low level:
I would use two stacks: one for forward history and other for backward history.
i go to tryexponent.com => this url will be stored in backward history stack.
i go to google => again this url will be stored in backward history stack.
i press back => data from backward history will be popped and put in to forward history stack.
I press forward => data from forward history stack will be popped and put in to backward history tab.
Also, whenever i go to any url,"See full answer
"@Jacob, your videos are really good and helpful.
I want to know about the tool, you use for explaining the design in the videos."
anush - "@Jacob, your videos are really good and helpful.
I want to know about the tool, you use for explaining the design in the videos."See full answer
"Great explanation on each of the components and their use.
During the interview would a PM candidate be expected to go in-depth for capacity estimation (e.g. storage estimation, bandwidth estimation etc.?)"
A B. - "Great explanation on each of the components and their use.
During the interview would a PM candidate be expected to go in-depth for capacity estimation (e.g. storage estimation, bandwidth estimation etc.?)"See full answer
"Functional Requirement
User should be able to add review the food item/order
User should be able to rate the food item delivered
User should be able to Like/Dislike others reviews
User should be able to see all reviews on a food item
Users should be able to receive rewards based on criteria- (Quality of the reviews- Based on number of likes - Monthly cash card)
OOS - Item is already ordered and exists in a separate system, User is authenticated. No Media
Non Functional requireme"
Anshika R. - "Functional Requirement
User should be able to add review the food item/order
User should be able to rate the food item delivered
User should be able to Like/Dislike others reviews
User should be able to see all reviews on a food item
Users should be able to receive rewards based on criteria- (Quality of the reviews- Based on number of likes - Monthly cash card)
OOS - Item is already ordered and exists in a separate system, User is authenticated. No Media
Non Functional requireme"See full answer
"Designing a Price Drop Tracker system like CamelCamelCamel involves creating a platform that tracks price changes for products on various e-commerce websites and notifies users when prices drop. Here’s a detailed system design for such a service:
Functional Requirements
User Registration and Authentication\:
Users can register and log in.
Support for social media logins (e.g., Google, Facebook).
Product Tracking\:
Users can add products to their watchlist for"
Scott S. - "Designing a Price Drop Tracker system like CamelCamelCamel involves creating a platform that tracks price changes for products on various e-commerce websites and notifies users when prices drop. Here’s a detailed system design for such a service:
Functional Requirements
User Registration and Authentication\:
Users can register and log in.
Support for social media logins (e.g., Google, Facebook).
Product Tracking\:
Users can add products to their watchlist for"See full answer
"In the API design, the interviewer is switching between RPC style (operation based endpoints) and REST style (resource oriented). Sticking to one convention and explaining why it is preferred over the other e.g. REST if the twitter domain maps nicely to resources e.g. /tweet or /follower or /user would help to create a more consistent and unified API. It would make it easier for clients to integrate with the API as well."
dreamingincode - "In the API design, the interviewer is switching between RPC style (operation based endpoints) and REST style (resource oriented). Sticking to one convention and explaining why it is preferred over the other e.g. REST if the twitter domain maps nicely to resources e.g. /tweet or /follower or /user would help to create a more consistent and unified API. It would make it easier for clients to integrate with the API as well."See full answer
"Since there is a need for the data to be accurate and consistent without any latency to allocate a spot, can't the data be synchronously synced to replicas after every write as the number of writes are not many per min, instead of read lock phenomena
Let me know if i am on a wrong thought here."
Chitapuram N. - "Since there is a need for the data to be accurate and consistent without any latency to allocate a spot, can't the data be synchronously synced to replicas after every write as the number of writes are not many per min, instead of read lock phenomena
Let me know if i am on a wrong thought here."See full answer
"System Components
Data Collection Layer
Posts with hashtags are asynchronously sent to Kafka topics
Each message contains: hashtag, timestamp, userid, postid
Multiple Kafka partitions ensure scalability and fault tolerance
Processing Layer
Apache Flink processes streams in real-time
Implements sliding window aggregation (1hr, 24hr, 7d windows)
Calculates topic popularity using weighted metrics:
Post count
User engagement (likes, comments)
Unique user"
Usman B. - "System Components
Data Collection Layer
Posts with hashtags are asynchronously sent to Kafka topics
Each message contains: hashtag, timestamp, userid, postid
Multiple Kafka partitions ensure scalability and fault tolerance
Processing Layer
Apache Flink processes streams in real-time
Implements sliding window aggregation (1hr, 24hr, 7d windows)
Calculates topic popularity using weighted metrics:
Post count
User engagement (likes, comments)
Unique user"See full answer
"The addition of an intermediate "sanitization" ML is something Neeraj used in the Uber Eats design and again seems kind of outside the scope here and redundant. This can simply be built into the AI response model to save a step. It's not clear what benefit this step provides, and he basically said we should have it "just because it would be good" and there's no concrete reasoning why to include it.
Adding a Kafka queue to handle the thumbs-down ratings? For what purpose do you need a queue othe"
Robert H. - "The addition of an intermediate "sanitization" ML is something Neeraj used in the Uber Eats design and again seems kind of outside the scope here and redundant. This can simply be built into the AI response model to save a step. It's not clear what benefit this step provides, and he basically said we should have it "just because it would be good" and there's no concrete reasoning why to include it.
Adding a Kafka queue to handle the thumbs-down ratings? For what purpose do you need a queue othe"See full answer
"Wrote up a simple cache system using python dict. Added TTL requirement. Then went into code-level concurrency issues for the cache."
S R. - "Wrote up a simple cache system using python dict. Added TTL requirement. Then went into code-level concurrency issues for the cache."See full answer
"The question is bit vague (I guess deliberately) so I believe firstly we shall ask questions and resolve ambiguity. Some initial questions could be :
1) Is this one time activity or something that should be done on continuous basis. If continuous basis then at what frequency.
2) How much staleness is acceptable in SYSTEM Y data
3) Are there any limitation in SYSTEM Y and is it fair to assume that we would need some kind of transformation to bring data into SYSTEM Y schema.
4) What kind of vol"
Kshitij A. - "The question is bit vague (I guess deliberately) so I believe firstly we shall ask questions and resolve ambiguity. Some initial questions could be :
1) Is this one time activity or something that should be done on continuous basis. If continuous basis then at what frequency.
2) How much staleness is acceptable in SYSTEM Y data
3) Are there any limitation in SYSTEM Y and is it fair to assume that we would need some kind of transformation to bring data into SYSTEM Y schema.
4) What kind of vol"See full answer
"Rate Limiter is to limit the number of request from a particular IP Address. Rate limiter will block the IP address to reduce the load on server. It should be highly available and handle concurrent requests. Blocked IP addresses should be kept in a pool which is present in shared cache. We need to keep threshold value after it reaches threshold value it should start blocking IP address.
All these ip address to be kept in No SQL DB. Batch will run that will clear the cache and delete all the bloc"
Ashish G. - "Rate Limiter is to limit the number of request from a particular IP Address. Rate limiter will block the IP address to reduce the load on server. It should be highly available and handle concurrent requests. Blocked IP addresses should be kept in a pool which is present in shared cache. We need to keep threshold value after it reaches threshold value it should start blocking IP address.
All these ip address to be kept in No SQL DB. Batch will run that will clear the cache and delete all the bloc"See full answer