Amazon System Design Preparation (SIP)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] I'm Samir Koppel I'm a software development manager at Amazon today are we going to be talking about the system design portion of the interview at Amazon we build scalable reliable cost optimal and performant systems and system design is a very key aspect for it we build distributed systems and platforms that are used by millions of users in your interview you will be asked to design a system and the three key things that I want to talk to you about while you do so is one don't jump into solving the problem try to understand what the question is go ahead ask more questions ask questions about the scale about the performance about whether it needs an API and then lastly try to make this a conversation between you and your interviewer you want to go ahead and solve it like you would do with the team right so go ahead talk to your interviewer about hey this is what I'm thinking this is where I'm going with this these are the key components of the API so today's system design problem is going to be designing an online bookstore let's think through when you get a question like online bookstore this I'm pretty sure everyone thinks about a lot of things let's start asking those questions it's a very vague and ambiguous statement to design an online bookstore so the first question that comes to mind is what kind of books is it going to be ebooks or just regular books right and I would say write those down so you can be as you get your answers you can say ebooks regular books as I mentioned earlier asking questions is key it's helping you clarify the requirement it's helping you set expectations with your interviewer on what's expected so you can start asking questions on scale how many users let's say six million users ask what are your transactions per second are going to be let's say 500 transactions per second writing this down is going to enable you to come back to this while what you're doing your design a lot of times we end up getting requirements but not using them in the design so you're actually missing those expectations again make sure that you're having a dialogue with your interviewer right it's like think about when you're in a room and trying to design for a team you know step away from this being just an interview think about you're actually designing a system that's going to be implemented by someone the other thing I'd want to call out is ask if you have any assumptions that you're making ask them and validate those right it could be like I'm assuming there's a payment service or there is order service that actually exists the other thing you want to do is focus on your strengths if you're a good front-end developer start by identifying the use case start with your front-end if you're a back-end or a database person go ahead and start talking about the database start creating those entities and work up to the front end from there all right so let's get into this let's go ahead and identify what are the key components here so you're gonna have a front-end you're gonna go ahead have a web server and then lastly a database these are the high-level components that you have that you're gonna go ahead and work with as we go through the process we're going to start going into details of each one you've got to work with your interviewer on what's the right level of detail your interviewer may interrupt you and ask you questions that doesn't necessarily mean that they're not happy with the answer what they're looking for is more data or more details on it so work with them and as I mentioned previously have that dialogue right so it's it's like you're in the room trying to talk to a team right so let's I'm a a backing guy so let's start with the database and then work our way up to the front end [Music] all right so let's start the database and what do you want to do is you want to identify the key components within the database so we're now starting to get into details over here you'd have something called a customer you want to get into more details of what is it that you want to capture about a customer you want to go ahead and capture the name generate an ID for that customer you want to go ahead probably capture the address other demographic details that you might need the next entity is going to be an order entity because what does the customer the action here is the customer places an order same thing with the order you want to go ahead and capture a transaction ID payment methods date of the transaction so on so forth and then the other entity that you want to go ahead and capture here is the books itself again at the book you'll have an ID for a book and author and you can add more details about the version of the book the date of release etc etc again work with your interviewer on the level of detail that they require [Music] so now that we've got the database done let's talk about the API this is a key aspect of how the data is going to be served so you want to go ahead and talk about how to construct an API you're gonna have a domain you're gonna have the resource that this API is gonna act on and then if you need any additional parameters you want to go ahead and describe this to your interviewers so they know that you have an understanding of how an API is constructed what does it do the next thing you want to do is go ahead and talk about a use case let's take an use case over here of inserting a book into the table it's going to be an HTTP POST operation you want to now use the API URL and construct it you want to say xyz.com slash books and that's going to be an HTTP POST when you do a post you need a JSON object so go ahead and describe a JSON object it's going to have an ID it's gonna have an author it's gonna have the price of the book as you do that you're describing to your interviewer an understanding of the JSON objects and then when you go ahead and have done that you can talk about other operations like an HTTP GET on an HTTP put or a delete and talk about what where or what those use cases are and how they can be used right you also want to go ahead and use the examples or the requirements that we got before about an e-book is this going to work for an e-book is this not gonna work for any book what are the changes that you would make then you want to go ahead and talk about the transactions is this API going to be able to support 500 transactions per second and as you do that you're gonna start building a much closer diagram of how your architecture is coming along so this is going to lead to a service-oriented architecture [Music] all right so let's see how that architecture is coming along so we just went ahead define the database we spoke about some API is I'm gonna call them services so you could go say order service you can have a payment service can have a service for books you can have a service for search you can have more services you want to go ahead and define how these interact with each other you want to go ahead and define if it has each has its own database or if they have different databases and you can start getting into those details with the interviewer at this point you might get more questions on what each service does whether you need to have different services whether you can group them into one can they write to different databases and so on so prepare yourself for having answers to questions like that and now this naturally progresses into the front end and how it's going to utilize these services all right so now let's bring this design to life right it's going to be through user experience and to the user interface you want to go ahead and define what that homepage or the landing page for that website's going to be like I'm going to imagine this is a search box with a search button on it it's simple you can go ahead and talk to your interviewer about this and ask them if this is okay they're expecting more if they want things like recommendations how you going to tweak your design to go ahead and do that and that's a conversation that you can have but for now and for simplicity we got to keep this as a simple search box with a search button on it I'm going to type in XYZ hit Search this is where you go ahead and connect it back to your design you can talk about what this search button does it invokes the Search API it goes ahead and passes the parameter for the book then it calls the books API which goes ahead and gets the book and then lastly once you have the response object back you want to talk about how that page is going to look to the user you can talk about having an image of the book the name of the author the price of the book and so on this is going to give your interviewer a good idea of you understanding how to render the response that you get back we just saw a design come to life from back-end all the way to front-end we had a conversation with our interviewer we gathered all the requirements go ahead and listen to your interviewer they're going to give you tips they're going to give you guidance through the interview and help you come up with a great design [Music]
Info
Channel: Amazon Web Services
Views: 55,806
Rating: 4.6254683 out of 5
Keywords: AWS, Amazon Web Services, Cloud, cloud computing, AWS Cloud
Id: gf8R7sgme6o
Channel Id: undefined
Length: 10min 42sec (642 seconds)
Published: Fri Mar 06 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.