is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
I don't have too much idea of System Design Question neither I have used Amazon Prime Video. But I will try to answer this question according to my perspective.
First we have to think of the functionalities available in Amazon Prime Video:
1. Account Creation of New User
2. Account of User
3. Saved Videos of User
4. Categories of Videos
(a) TV Shows
(i) Entertainment
(ii) Sports
(iii) News , etc.
(b) Movies
Let's first try to design with only these functionalities.
Storage Scalability:-
Assume there are 100000 videos streaming at a moment in Amazon Prime and we can also assume size of each video on an average be approx. 500MB. So, total size or space required to store these videos in the database is= 100000 x 500MB = 50 TB (taking 1000MB = 1GB).
Now assume you chose a machine which can take store upto 10TB. So, number of system requires = 50/10 = 5 machine requires. And we also have to store the redundant copy of the server so as if in the case of server breakdown the request can have a correct response using other redundant server. So, we will have 2 more redundant server. So, total machine required = 5x3 = 15.
Design Goals:-
Designing of the system will be according to CAP theorem, which tells that we can attain any two functionalities of the three i.e., Consistency, Availability, Partial Tolerance. Which two of the functionality we require ? Availability is the must as for each request there must be a (non-error) response. And we are more in need of partial tolerance rather than consistency, because we don't need each updated response but we need the system must work even after break-down.
Latency:-
We don't want a large latency in our system. As, there may be a large number of request each second. So, we will use Load Balancer to distribute the large number of requests among different servers to ease the burden of single server.
Do we need Sharding?
Yes we need Sharding as each day thousands of new videos are added . So, we need Horizontal Integration to increase the number of server.
What if any machine handling Sharding goes down?
If we only have one machine per shard, then if the machine goes down, all requests to that shard will start hitting the DB and hence there will be elevated latency. As mentioned in the design goals, we would like to reduce high latency cases as much as possible.
If we have a lot of machines, one way to avoid these cases would be to have multiple machines per shard where they maintain exactly the same amount of data. We can use the master-slave technique i.e., there are two copy of server and at any time a single server is active called Master Server and a redundant copy of master server is placed also called slave server which keep itself updated every time and activate itself when master server goes down.
This was all back-end part.
Now see some class hierarchy.
We will have a class called System, Videos, User,
There are many more things that can be done. As if you are implementing the complete design of Amazon Prime it is not done in less time. It will take a large time.
- superrishabh0 August 10, 2018Here I have just explained few functionalities that can be done in this way. It's just a try all suggestions are welcomed.