Low-Level System Design of an Inventory Management System like Amazon or Zepto

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey folks we are live today at uh on Wednesday 7 pm today the agenda is again a lower design of a system which is an inventory management system and if you know about Amazon warehouses or if you know about even you know uh shops what happens is people can buy products and you have to manage this inventory so simply put you have to manage the state of a product whether it's purchased or not purchased where is it how many of them do you have and do you need to order more based on that maybe a notification so this is the job of inventory management system and the low level design of that which means the software design and the code will be taken care of by us today okay so with us we have Arun goyal Arun is uh SC2 at atlassian uh I don't like to say a few more words about yourself or are you very humble and shy or what is it like uh of course I'm humble and shy but let me give a few words so hey everyone you must have seen our previous video I gave my introduction there also my name is aren't good uh I'll try my best yeah okay so um let's let's start this way uh firstly guys if you have any questions please send them on slido so right now I'll just share the link for slido you know um give me a second sorry I have not opened YouTube at the same time because the sound becomes an echo yeah okay so let's go to it's in the description the video description oh in fact we don't have a slider Link in the video description yeah okay okay let me just create one uh guys thank you so much for your patience and uh no thank you for me for you know forgetting to do this I should have taken a slider link and kept it out there just give me one minute okay okay in the meantime I can take a few questions yeah which are coming on track because okay so uh there's relationship saying can you list down a sort of rainbow to tackle similar questions uh yes uh in the last video if you have seen uh we came up with the idea how do we generally proceed uh we can go ahead with a use case diagram uh wherein you can list on the requirements and based on that you can make a use case diagram using the use case diagram you can go ahead and create the class diagram and probably after you make after you make the class diagram you can go ahead and write the code uh for reference you can refer to the previous video which is on make my trip uh you'll be able to have a good idea about it so Lakshmi is saying hi to you gaurav please reply hello how's everything going I'm taking a poll also at the same time which will launch the school and at the same time I'll just come over here and please use this link to send us your questions or ask any doubts or even if you have suggestions please let us know here I have taken a poll uh on you know what is your experience level so that we have a rough understanding of who's the uh who's viewing this video and based on that we can tailor the experience right so okay three of you have voted three to eight years experiences where we are at till now okay I just share my screen if that's okay with you yeah yeah go ahead okay I'll just share my screen uh okay so this is the poll that we are taking uh the slider link is in the chat again I'll just share this holes any resources for extreme beginners Amazon for SD one level generally they do ask relevant questions for SD ones as well Arun would you like to take this like if there is a person who's just starting off with a design it has absolutely no idea maybe has done only corporate programming or you know small projects or maybe has worked only on machine learning and is looking to switch to software engineering how do you how do you make them start just for the first time they are not in an internship also so extreme beginner I think it would be that yeah okay uh so my recommendation to them would be uh first start with problem solving basic problem solving uh then you should go for oops concepts are very much needed in uh deciding design patterns and whatnot then after you are done with uh you have few experience in solving problems you have learned a few algorithms and you're very much familiar with loops then you can go ahead and start designing systems you can uh start with very easy systems also uh let's take the let's take an example of car parking let's say you take that and you start designing that and then you can straighten like this you can move on to the complex systems okay okay so and would you say they need to learn anything beforehand any design patterns or you know should they work on their own project before what would you suggest would be so so my recommendation would be after you learn oh uh definitely any design pattern you will be very easily able to understand right uh so what my recommendation would be first start build your own uh for example let's take car parking only car parking is not that easy it's it's quite difficult actually but you first write your own then you will be able to see what all issues are there go see a few design patterns and how you can improve your code this way you'll be able to learn more design patterns and your code would become greater great great great as you move ahead and this way this is the best way to learn design patterns also I feel okay that's true practice makes perfect uh okay let's take a couple of more questions uh there are a few you know comments that please post the slider link on LinkedIn also um I have posted on LinkedIn guys do let me know if it's working and uh please feel free to you know send us your questions over here in Q a or just let us know where you're lying at in terms of experience level I think this is one way in which we can judge people very quickly uh not accurately but quickly that you know okay you have an experience level of eight plus years probably you are an expert uh you're a college undergrad means you are not you haven't started with global design so like I said it's not accurate but it's a quick way okay there's one more question Priya bansal is asking okay lld round tends to be become machine coding around how to analyze how much depth we need to cover during these interview times okay uh Arun do you want to take this yeah uh so uh first of all uh how much depth is just decided in within the interview if the interviewer wants you to go into the depth of it or he just ask you to be superficial so and how's that decided uh when you start with jotting down the points system requirements that's the first thing like we uh like you must have seen in the last video also we jot down the system requirements and then we started moving into the use case diagram now what happens in our interview is the interview can go in any direction whatever uh interviewer is not convinced whether he can go into depth of it so you just by the interview link you might not be able to get uh how much depth you need to cover uh but yeah most of the things are understood uh in this when you start writing down the requirements if the interviewer is not convinced with the requirements they would uh question you there and then but once you have jot down all the requirements once you both have agreed you and your interviewer that you will be designing system on the base of these few requirements then I don't think he'll be he'll have any other questions going forward okay okay so that's that makes sense yeah also if you're worried about the machine coding around like Arun said as they keep going deeper and deeper they start asking more on the engineering side of things in which case maybe depending on your experience level if you are looking for a sd2 or sd3 role then they will be asking you stuff like concurrency uh you know locks how do you how do you keep low latency how do you so low latency for example you know you don't want a thread to be blocked that's that's the level that we can go to in an interview we can't do like uh a lot of optimizations but yeah no latency is one thing maybe using the right data structure okay it won't be as difficult as and I'll go around but they'll ask you something simple like are you going to use a hash map here are you going to be using a a list over here why would you use that basic things okay this is interesting are you comfortable with LED rounds 19 people have voted at 20 now and we are seeing most of most of the votes are on one so they are not comfortable with LED uh yeah very interesting so what's driving that is it that you know you haven't given an LED round or you have given it and it didn't work out uh that could be one thing maybe you can let us know in the in the Q a okay uh there's a couple of questions that we have over here let's take questions for four more minutes before we start so the highest voted question is do we need to learn each and every design pattern if not what is common and important ones that we must that everyone must know do we need to learn each and every design pattern I mean if you know it it's kind of useful only but if if not what are common and important ones that everyone should know so if you had to rank order design patterns or if you had to say the three most or five most important design patterns which ones would you choose uh so uh to this let me ask the answer the first question uh do we need to learn each and every design pattern so to this my answer would be uh nobody can actually learn all the design patterns right uh it uh you would get better and better in deciding with practice first of all second uh if not what are the formulas so there are frequently used design patterns for example facade pattern is one uh which is most frequently used uh Singleton pattern is one which is very uh commonly used uh publisher subscriber pattern is one which is very much used for example in social media you can use it or like social media apps with one such example and it covers a whole whole lot of systems like Twitter Facebook Instagram uh YouTube also now nowadays they also send notifications uh to the subscribers uh publisher subscribers fourth I would recommend uh then decorator pattern is one which I would recommend that you must know it's quite watching yeah I guess really website that you would suggest people to go and just read the theory like I find this one pretty useful refactoring Guru okay um like this is a lot of this is useful um design patterns let's just go to design pattern let's say creational there's quite a few I think factories like Ultra common Builder is super common Singleton again very common yeah okay uh there's another interesting uh question which has come up which is any idea okay so would you like to say no let's let's keep it in stealth uh it's not stealth actually we are working on lnd course Akash thanks for the question uh and uh it's it uses these things like design patterns some some basic understanding of course we explain what the design pattern is also and how it works in this particular question but if you just want to use design patterns or if you want a textual summary of what design patterns are I would strongly suggest you try this website I've been saying it for a while now nobody goes when I say high level design please go for uh Martin klapman's book designing data intensive applications I don't know how many people have read it but it's a really good book this website is also really good it gives you a good gist okay uh if you want to see them happening in practice Yeah we have at interview ready high level design questions and for lower level design we are creating a course so that it helps you primarily for an interview preparation and upskilling but the theory is already covered so we don't want to cover it again and again uh we'll cover it only for the questions that we are doing okay so the second part of the question which are the important ones Factory method or factory pattern um Builder Singleton in my opinion uh structural ones I would say I've heard a lot of adapter and all that but I've never really used it decorator is very common so simple that in fact I I don't even think this is the design pattern it's like Common Sense uh I don't know about this one I get composite uh flying weight I guess I have never really used these much facade like you said uh this is also yeah this is also a thing in behavioral there is chain of responsibility I had seen in one project State and strategy being used together and that code never went to plot so oh we can yeah people read design patterns and they just go and they're like yeah okay but State pattern I think is is actually quite common uh depending on the state of this object treated in a different way strategy I mean it can be used usually there's a Code repack there's not so much this thing has to be done in a different way okay and visited again I had seen this nonsense one uh in some cases it must be useful let me tell you in the same company in the same project that I worked for they first tried visitor pattern then they tried State and strategy together none of that code ever had any impact on anything okay so sometimes you might be trying something for the sake of trying it don't do that uh important ones may be chain of responsibility uh state in structural facade adapter yeah and in creational Factory Builder and Singleton creational is more often a design pattern problem because dependencies is a problem and when dependencies are complex or creating objects is complex that time you want to use certain patterns which are well known in the industry this is a place to go I haven't shared it uh is it I haven't shared this link I'll just share it here refactoring Guru place you can Google this also and when you are Googling it uh maybe you also want to get some advice on where to launch system design which is a pretty decent website interview ready okay yes but man computer researcher this is the book that I'm talking about you can buy it on Amazon or I think O'Reilly also sells it okay okay I think we have taken a few questions uh this I think was the most important question that we had what would you recommend for Learning System design that's taken care of that's great uh High gaurav when we start lld course yes we are we are working on it I have never given anything yes uh I have a Amazon SD one interview soon any advice regarding LED now to watch this interview uh watch this mock interview and let's see if that helps you out how to buy time while thinking about requirements don't try to uh be too fast also keep the interviewer in the loop talk to them don't try to buy time involve them in the discussion okay uh can you please tell about the time planning for the little round I mean how much time for discussing question requirements designed I'll go I'll go for question there is no set pattern the faster you complete a question the more impressive it is simply and so I and Arun are working on a method to do this the fastest way possible okay as you'll see today is it required to write algorithmic logic in lld for example I got a job scheduling algorithm should I write different types of scheduling algorithms or do you want to take this we'll take this uh should need not to write a different algorithms uh just you uh so there a person is not looking uh at the most optimized algorithm actually personally is looking at the interviewer is looking at the most optimized code so uh so do not think uh you might not have to write the full full uh uh function definition also you can just give a signature of it and that would be great so in interview anyways time is very very less they just want uh to see how the activity flow how you how you operate the system which functions are called when are they called how do you exit what is the overall activity flow uh what all classes will you make how will you interact how the customer will interact with the system all of that different different types of algorithms makes total sense in fact if you write the algorithm in the LED round also then I mean I don't know uh there are libraries which take care of some of these things uh one question which is kind of off topic so I removed it which is basically uh I have a startup that I'm working on an idea and I've been doing algorithms and should I make everything extensible from the start my advice will be no just first look at what the customer wants they don't care about your algorithm as long as the problem is being solved they don't even care about tech like Arun is also a startup founder and uh is is that okay I don't know if I put it out yeah yeah Arun doesn't just like me I don't does not uh have a fascination with technology for the sake of Technology we just solve problems and if tech is necessary to use Tech okay so lower level design uh offer management system okay Inventory management system so okay I don't you want to want to design an inventory management system I'll uh I'll walk through some of the requirements that you can tell me if they are what is expected of an inventory management system sure okay so the first thing I can see is um add products this would be something even in a small shop we would need a type of product okay this will help our onboarding you can say Okay product on boarding okay um another thing would be I mean a dating product value yeah so I'll make this more explicit I will say add product units and remove product units would that make sense like if I've gotten if a customer purchases something I remove that product from my uh total list yeah and when I get a truck in the morning it fills the uh you know stop that's when I'm adding okay so in this way I'm able to manage to some extent and I can add product types also okay uh okay is there anything uh else that I need to do uh I need to manage the price of the product but is that in product onboarding uh so uh like you said uh in the last 10 product uh change product values so in that you can change the quantity also in the price also the values could be both of them and replacement also uh shelf actually where is that place because in Amazon generally uh they have robots to pick up the uh product it gets packaged itself so they have a proper shelf Place uh where that product is okay so uh so this is going to be a product location uh at this point we are now starting to get complex because in a small shop I can manually go and just put the products in the right place in a warehouse I need uh I need information like in this product onboarding I need what is the volume of that product because if it's too big then I can't place it in the place and also how heavy is the product maybe based on that I want to put it in the ground the lowest tier and take it so the weight so this this should actually capture that I need weight and volume Dimensions it will be even more accurate so you can have three sort shells for for to keep to simplify it let's make it small medium big that's it three types of shells okay okay small medium okay I'll just make it s m and L you've spoken like a true Problem Solver yeah small medium for now let's just start with the simple basic thing bucket them okay we can update product prices we can tell where it is located so a particular shelf a particular location we can add units I mean adding units like even if I say 10 units then yeah it has to be assigned particular shelf uh slots also okay remove from some slots um it's almost like Hotel cooking right like this uh no something some things would be there uh yeah some things might not have anything right right because humans come and book one one of them uh you can't put them anywhere you like they might be choosing the seat also okay yes um I can't think of any other requirements uh are there any other requirements like uh is there a discount offer that I want what about a sale should I take that also into consideration or should I have a that has nothing to do with inventory uh yeah no that has nothing to do with inventory what we can think of here is a package a product in inventory uh some of the products packaged are placed and they would be out for delivery after some time so you can take care of that as well okay okay okay so the the status of unit uh so whether it is uh uh available packaged already I mean uh in transit in a warehouse I just care about if it is available or it has to be picked up uh okay so now now if it is available that's okay otherwise it is booked uh then it is [Music] a Bad Robot let's say then it is packaged and it is ready for delivery yeah so maybe yeah so what I'm what I'm seeing is there are multiple states that a product can have a unit can happen if you have a practical product okay okay okay let me actually imagine as a customer what happens or and then let me try to imagine how the robot what's happening so as a customer I walk into the shop I look at the product that I want to buy I just pick it up I go to the billing counter um yeah now at the billing counter what should happen is when I purchase the product I leave so for me it's actually extremely simple for the shopkeeper they need to know which product was picked so maybe the barcode when they swipe that barcode that product is uh you know noted uh one unit of that is subtracted and the bill is generated the bill generation is a separate thing we don't care about that yeah it's just they have to subtract it by one so that is easy okay so there's one more thing that happens in the warehouse uh so whatever is finished now so every day we have to purchase orders also right so the water shelves are able to we have to have those lists that okay these products are finished we need to buy them so our warehouse should have that list as well okay so how many uh were booked today is that something that we want or what is for example uh you're having Mouse oh let's say keyboard okay so so 10 keyboard are there in your shelf let's say now today all the 10 are finished now so obviously you would want to buy 10 keyboards at the very next day right yeah you should be able to know okay the keyboards are finished now and I need to buy them so that you can sell them ahead so that would come to know from the warehouse already right so uh maybe maybe some sort of a do you think a small report yes end of day right yes yes so let's put a reports of finished finished products like the products which are finished in the warehouse and uh this is one thing and the next thing which you can have is uh what was the sale which you did probably that can also be there and I think we'll be good to go yeah I think correct I guess reports and analytics can be uh we should note those events that when a person is purchasing something or something at the time we take those and separately we can generate a report out of it that 13 keyboards were sold in total we have 15 keyboards so you know probably get 13 more keyboards tomorrow so okay okay so this is great this looks great okay then then I'll just uh go ahead with the user also guys I'm using lucidchart you can use any software that you like always I mean I should have checked with Arun first is this okay if I use the software right so in interview it's not but yeah for now it is I mean why would you not allow it in an interview okay so I would allow in an interview actually but it depends uh really on the interviewer right you're right actually that's that's one thing like you would allow it because I guess you are reasonable yeah I I mean to say like uh always ask the interviewer if possible can I can I use this tool because it simplifies some of the things that you're trying to do like drawing writing neatly uh these are things that I see many candidates are not able to do and for no fault of their own sometimes it is their fault they haven't even asked but sometimes yeah like if the interviewer is adamant that's their fault not yours if you don't ask you will they'll never say yes so use as many tools as you possibly can to make your interviewing process easy it's going to be a tough interview anyway so it's best to have all the tools that you possibly can we use an IDE if you can use an ID nothing like it if they are going to force you for Google Docs then okay we'll handle it when we need to okay so these are seven requirements that we have um add and remove is largely update product unit yeah I would say we have roughly six requirements only product units the count has to be updated we need to onboard products the products have a particular weight and size uh the product price can be updated is this part of the inventory management system yes okay okay I am I'm seeing this is so we can have it for now yeah I think these two will be strongly coupled so maybe we'll make it a single requirement early yeah yeah okay and then we have product location where is it being stored okay that's dependent on the weight end size so one two three four and five yeah report an analytics of how many sales have been made how many products have been sold which products have been sold so on uh and the status of each unit is it packaged is it yeah is it cooked and everything okay so this this took us some time this took us 10 minutes uh now the proof is in the pudding let's see if this actually speeds up our thinking so I'll now uh before going ahead do you really think these are the requirements of the user yeah for the user uh who's using the inventory management system they just care about updating Product Company yeah yeah so just this product yeah they care about this also okay this is manual let's say this is manual product price let's say yeah okay let's let's put it here these are two things that the user cares about that they do manually yes yes so okay and reports analytics they view it themselves but they don't say this is generated by System yeah this is generated by the system yeah yes maybe they can get it on the email also so whether they view it or not is like talk to us okay status is handled and product location is handled by the system yeah I think you're right just reports and analytics is the requirement of the system I feel yeah still let's see if we get a okay AWS is really good I concerned okay uh so this these are the requirements of a system not not the user okay yeah okay so then we have two actors in the system one of them can uh add products and update product counts one of them handles the location of the product and the reporting and analytics generation and also the status of every product okay users yeah this this guy doesn't do it and that's a that's some input to the system that means purchase something so just to clarify a user is a shopkeeper is that or a warehouse manager yeah user could be a shopkeeper also you warehouse manager also or some employee also so there could be different uh people actually so in people also you can have levels so you can have a worker you can have a admin you can have a manager so but for this interview let's leave it let's just talk about admin okay then that's good okay I am thinking that you know update product count is something that an admin sometimes needs to do a user sometimes needs to do but most of the times all we need is yeah so exactly but price is something that a user does yeah so so updating uh could be both of them's responsibility here okay I I agree uh maybe both of them do it sometimes yeah yeah okay product onboarding is something that a user only does product location this is a system reports and analytics I I guess they create it and then they are viewed by uh the user yeah okay okay I don't know if this is strictly uml but uh roughly I think the requirements are here anything else that you would like uh me to look into uh no I think this should be good okay let me uh now try to convert this into a class diagram sure but the idea that doing this is going to speed up the code later on yeah so okay I'll take the first class which is user okay and uh let me in fact I just draw using this class diagram as my reference user can do product onboarding uh and update box unit counts okay so one thing I I'm going to do is I'm not going to assume registration of a user and all that I'm just skipping for now if that's okay yeah yeah that is okay okay so user okay a user uh I'm assuming all users are admin is that also all right but they have full access okay yes for now all right so they can onboard a product means add product okay and the product details will be passed in as a as a parameter here they can update for our account so update account and they pass in the product ID and the count reduces okay so in case you are getting rid of products uh there is one problem if I have some products in shelves let's say a product Type A is there on the shelf and now I say product type a equal to zero I update the count then that shelf also what happens to that shelf that becomes empty that becomes you can imagine yeah the problem is okay yeah that's that's a admin is specifically saying remove this product or remove this unit then those shelves become empty okay so this is a rare admin action foreign let's also look at what the server can do or the system can do it can generate reports and analytics so generate reports okay it can also set or get a product's location so manage product location and then set product location okay uh also it can see the status of a unit so manage the status of a unit as available update status and in this it passes product yeah okay yeah this is we have talked about product a lot would you mind creating products also yes yes uh absolutely so there is a object called Product it has an ID it has let's say a price at this point I'm not assuming any offers or coupons or discounts um okay it has a description it has a like we said I'll just Define over here the product we mentioned as a price has a weight and a size yeah so wait that's nice I guess what we are trying to do is either Amazon warehouse or even zepto or um so big basket Grocers or not just e-commerce store a normal Mall also as an inventory right any Hall which you go that also has an inventory that's true that's true yeah okay so we talked about product here uh product count is being updated we have uh reports so maybe report object can be created but we'll first look at this thing location which is actually the next video so actually this is the product It's also two things that I have to remember is unit uh we are mentioning this in the in the use case diagram products have units so it's of a particular product ID a unit has this so should I say a unit has size and weight or should I have it in product is a question I'm thinking right now uh how do I so uh so what you can do is like we have discussed in the requirements that the shelves would be of three types small medium right so you can define a product type also that if it is small it can be put in uh its location could be small medium and big all three locations could be there if it is medium so it could be put in medium and large only and if it is of type large then it would only be put into large height last time which means you will have to create a class shelf also now sure okay okay so I've kept location as that class which says that there is a okay type small medium and large and so shelf actually doesn't have anything else except an ID location uh yeah so a unit is of a particular product and it is stored in a particular location a unit also has an ID let's say and it it needs a status a unit needs a status is it sold is it uh booked right now I mean is it available what is it like so you can have two status for now uh uh in the uh so inventory means it is not sold uh in the transit means it is getting packaged and delivered means it is ready for delivery so you can have an enum let's check off State okay I mean number Status where inventory Transit Transit and the delivery yeah okay so every product has a location so if it is in transit does it have a location uh in the sense it's been removed from the location I think I mean that location will come now yeah it's been removed okay so it's removed from the location and yeah should I okay so I think this will come a little later uh maybe when I'm writing the code but I'm just thinking that should a location also have a Boolean value or a unit ID which is occupying it so we have a one-way mapping where unit is pointing to a location this so I'll just mark it in a separate column this is pointing to this and this is pointing to this but should a location also say if it is occupied that you know the unit is this one maybe I can take care of that separately maybe I can yeah maybe that can be taken care of separately one unit can only occupy one location one location can have different units Depending on time yes yes okay so you're so you're you're having ID right which is a unique thing right yeah what is the unit yes okay so okay uh we have in a user what about a user user has almost no State because we are not handling permissions or any kind of uh yeah everyone has the same permission so it has no State system also does not have any state uh okay uh what about the data members we have talked about it will have list of products right system will have list of products yeah system has a list of products yes yes yes and the system also has a location that's the list of units okay so yes that's true so in fact let me pull this up again and say what are the things that a system needs the system has list of products yes we need that also location was being managed by System yes so system will have list of all the shells availability right yes some something has to take care of this so uh get list or let me make it an even simpler uh thing get product if you pass in the ID you get the product uh add product okay I guess that's taken care of by this user get product also is taken care of now yeah Place product Maybe so it sees some location which is free I think right now the first location which it finds which is and uh or adequate size it just fills it so this is going to use an algorithm so and finally uh I mean products can have expiry also right for now that issue here yes for now let's keep it aside but it is a thing so we will if we can then we'll see if we can manage this there is a place product uh algorithm and then there is basically uh get list product list okay uh so yeah get unit Place unit I would say is the right term in our vocabulary or getting the whole product list you mean give me all the list of products that are available so that a user can purchase yes product list as well as of course uh where will a system so if for example you want to see the status of all the shells in an inventory it happens right a user goes and sees all the shells so correct product list and get shell status so you can so basically it will have a list of all the shells also now okay get shelves status let's say and then this is the capability of the system that we have yeah okay walking back again uh for every unit you can get and place a unit and if you get a unit I guess you can uh sort of get unit it's retrieved the unit or remove unit okay so you can explain me three flows here now using this class diagram one first flow you need to extremely is when a product comes so suppose the warehouse have bought off got the truck of products so how would that be placed in the proper shell so one is product onboarding which you need to explain me second is second is how even up when somebody has purchased the product so from Shelf till the delivery what what would be the activity diagram for that and the third one should be at last at the end of the day you need to show me the report also so okay that means so please tell me all the details now so in the first part where uh a set of products come in uh and they need to be added to the system uh at this point we are going to be I think as a user I also need to be able to add unit basically so I can do that as well Okay add add product uh is adding a product type in my mind so maybe I'll uh this this adds like a new type of biscuit has come in so okay I'm typing the I'm adding the type of product so that is this this part this is a all the metadata for the product a unit is one instance of that product okay so once a truck comes in maybe with 200 units I uh I'm going to call this place unit function 200 times with okay units okay uh then uh This Place unit is going to use its algorithm to put them in the right locations and now my warehouse is full okay let us let us now assume that orders come in a person wants to purchase so they mentioned the type of product that they want to buy and they say give me one instance or three instances of it so right I will uh I think I need to have some sort of concept of an order also a very basic concept I don't have money or anything involved in this or the status of an order I just have a clear order which says unit uh stuff unit I'll call this count okay I'll take one step back actually an order has n number of products with each of them having different types of units different number of units so three million two boxes of chocolates One keyboard okay so this this is a map of a product to count that is an order for me okay so uh so suppose uh some order has been placed right a system has to check if that product is available or not right yeah yeah so so now in this so can't we make it something like this a product we have said product how many units are there you have already taken care of yeah so in product only trying to uh have a list of units where it is placed Okay the reason I'm not keeping that here is because I thought I'll keep it in some other object like over here in system okay okay that should be great okay so if we then go to system and we ask can this order be fulfilled so for this product where are the places that it is being stored and filter out by status equal to inventory so then I'll get a count and I'll see can I satisfy the sorter otherwise gold okay okay um now at this point I know that I can satisfy so I have to take a lock on this because there might be a parallel order also working on the same thing so okay uh the products that I'm touching somehow I need some sort of a lock on all of them or I can make it sequential that per order I go through sequentially so okay and there is no way that you know two concurrent orders will come together right I would prefer if that were the case everything is being taken sequently in a warehouse also I mean it's I don't know if Amazon can handle this kind of week just everything happening sequentially they are going to multi-thread it um I could also take locks on every object here it could create it but now you can imagine for now you can imagine that uh the orders would be taken sequentially okay okay that is great so if that happens then I'm going to take it sequentially I'm going to find whether it is possible or not I will then uh update the account I'll also change the statuses yes and uh based on that then finally I will go to the location I'll mark them as once the robot goes and picks it up some sort of event has to come and somebody has to come and do this cleaning task of putting them in in transit or delivery status and the robot has to basically set the location IDs to though the map that we have here that which unit is being stored in which location this has to change to null okay so when the product be purchased when a unit has been picked up by the robot yeah there is no difference yeah it's done no no it's done it's done there is one small difference though if a product is purchased um and is no longer available that is okay but it is in transit I cannot if a truck comes right then and tries to add units I shouldn't pick this location ID so if the location ID is in is in any unit then we should not pick it up okay that's one Edge case okay this uh so this is the overall flow of the system you can now come and add products you can now come and purchase uh and I think arunia mentioned one final thing what is the third floor third was our reports at the night or maybe the end of the day yeah I guess that won't be too hard for me to do because I'll I'll take these events each of these events and keep pushing them to a queue and the system which is looking at this queue is going to take these events and give it as a report so cool I can create a report uh object but this is going to be let's say it's going to be generated on a particular date and that's it rest of it I'll use it as metadata um the reporting service can take care of this okay okay yeah okay so I think this should be good yeah okay so at this point I think we can take a couple of questions yeah on uh how we are doing if it's bad then please let us know I can't ask Arun directly because that way so someone is asking will it be a report of completely sold out product or we decide account where we say that we are learning loan inventory for a particular product so is it a report or is it an alerting system so it depends basically on the question actually that's why if you remember uh in the system requirements I said it could be a general report but I just want to see if your system is able to generate a report or not uh if I want how much sale I have done in a day you can very easily tell me right uh how what are things are finished you can very easily tell me because you have product list or you can iterate over the product list and then you can tell me okay all of these are finished so you can very uh it depends on system Pro System but what I want to see as an interviewer is if your if your system is able to generate a report on the daily basis or not okay so you are mainly concerned about can this system generate reports yeah got it okay okay um Rahul is asking how would you return a list of products in the inventory by given date how would you store the products data in the DB products data in the DP I guess we can store it by just mapping this class the first question is how would you return a list of products in the inventory list of products in the inventory for that you would be having by a given date what do you mean by buy a given date I didn't get that I guess if he gives you a timestamp or gives me a timestamp I should be able to tell him that these many products are there in transit in uh in the inventory being delivered but what is it how would that help but how would that help yeah maybe Rahul you can you can uh you know add some more to that question it will really help us where are we storing this is it no SQL or SQL today I was seeing this video of zeroda where they are using postgres to Triangle uh I think a few trillion data records so oh yeah just simple postgres here sorry yeah so actually deciding the databases I feel it's a high level design question yeah it is and in fact don't go for a nosql database unless you really really need to I don't see one thing in this not one which requires a high level like a like a write heavy database like a new SQL or something you don't need to inbuilt sharding and all that I don't see it happening here so okay how do we generate historical reports since events are consumed okay we will look into that where are you seeing Zero the video where were you seeing Zero the video just go to Twitter I've shared the link over there can we add product category also so unit placing on the basis of category I think a lot of these questions will be handling in the in the code so now it's eight o'clock let's start writing some code also uh generic question do you how long do you think a low level design now goes for so it generally goes for one to one and a half hours uh not more than that and I would like to tell people uh that right now we are explaining the question also we are taking your questions also we are explaining the answers also and I'm asking too many questions from gaurav just so that uh everything is clear to our audience uh generally these many questions are not there most of the things are clarified in the system when while you are noting down the system requirements only or when you're making the uh use case diagram generally database choosing the database all of these things are not generally discussed in the low level design and what an interviewer uh generally sees is he would pick broad broad things and probably he can go in any direction in an interview you should know this uh interview can go in any direction so the main thing is to convince the interviewer that you are right first of all this actually is the case even if you are wrong if you are able to make him understand he'll give you a good baby uh second is of course you should be right so discuss about stuff like the gaurav had discussed with me now he got an approval at every instant from me right so if he will do anything later on I cannot Point him out so try to involve the interviewer while you are making stuff be it use case diagram be it writing down the system requirements be it making the class diagram yeah okay yeah that's a brilliant point I think a lot of us have this thing that when we are coding we don't or when we are doing the interview we think uh the interviewer might get Disturbed and we say okay fine let's do it quietly uh while important parts you should get the integral involved if there is something important please confirm with them and clarify with them okay um so I'll be looking at the class diagram which we have done with so much effort to set this up there is a class user uh they are they are important but okay and there is a class order also but let me start with the core class which is basically the inventory system the system over here uh and let me then say what are the problems that we have so first method is initially a truck comes and fills up the warehouse so add product is the thing so add product and I'll return void which means if it is successful then nothing happens otherwise it throws an exception so yeah another thing is exception handling if your interviewer wants to know about this then yeah I can get into details but to start off with nothing for now okay so when it comes to add product there is a product that we can add important to Define that class okay product ID location an ID a price description weight and size okay this is a description here wait I'll take us double and let us assume metric units kg size is [Music] okay foreign [Music] okay now uh when I'm adding a product all I need to do is I need to add it to my list of products so it is a I'm starting off simple and when required I might turn it into a map of product or something but yeah so let's talk okay I'm using an ID as you can see this is really really helpful if I am not using an ID I would need to remember the syntax I would need to remember a lot of things but that's no longer the case here okay and now add it to my product list uh now what I do is also add a bunch of units so the truck has come I say that tell me the different types of products and now also Place unit so okay unit has to be defined so I'll take that class a unit has a product ID a location ID and ID itself and the status uh is this is actually interesting uh I don't would you suggest that I keep a product ID or do you want me to keep a reference for product okay uh so now here could be a good discussion actually uh keeping up a full-fledged product will take a lot of space actually right so yeah add value one of the trade-offs that I can see when keeping a product full product is it will take more space it might have used the speeds which are relevant only to product uh certain things if something is updated in our memory and we have this unit stored in a cache uh it's possible that if I don't make it a Singleton if I don't make each product class Singleton then this will become single um right and I'll have to manage a cash management and that memory uh these are the drawbacks the benefit is whenever I want to get any details about this product I don't need to keep a mapping between product ID and product in the system I can just jump to that right so I would uh prefer to actually have a product ID in the system just a just a mapping of uh per unit what is the product ID is that is that okay or would you prefer me to no product ID is fine uh because I think we can iterate on the list of products to get the information okay so then I'll keep on mapping off uh actually I'll convert this to a map say for a string uh I have a new hash mark yeah and I'm not making it a conquer and hash my problem is keeping it simple okay papers location ID okay location ID something else that I need so I need a location but before that in status I think you are mentioned inventory is one Transit is another and delivery is another okay another class called location has only type and ID Okay so string ID and naming this class location type because type is a very common word so I don't want to mess okay um I don't get it so what is Type small large medium okay so that is already taken care of sorry for that and this is size is here size of the location is being mentioned over here okay now when someone asks us to place a to place a unit I am going to be using an algorithm to find which location is best suited for this okay so right now yeah we can skip it we can skip it for now I've understood that we'll use an algorithm uh okay let us assume that uh I I don't have that taken care of I mean let us assume some algorithm is doing this location ID setting okay yeah so Place unit is something that we have okay okay so we can place units we can add products we can get product get product is not different all I need to do is just this uh very simple [Music] and let's get these methods moving forward because it's just get a set of methods yeah string okay get product list again this is I just need to pass in the I have to just return product list Dot yes that I think but Keys that's all I have to do all values get shelves status okay get me all the uh units basically or another get me all the locations and their statuses okay I can I can do that uh get me all the locations so I can keep a map of locations here yes so if there is a screen which is location ID uh tell me the whether it is failed or not or which product exists which unit exists there okay so yes I mean there are a set number of locations only so I'm keeping them all in memory uh and the unit is here location map public this is what I'm returning now comes manipulating this location map can we generate reports okay we can look at that get product location set a product location okay so I guess this is set unit location this is yes okay so get a unit's location or set a unit location get unit location is very simple we just need to go to the unit and say what is your location ID yes yes set unit location is what we are looking at which is basically Place unit so I think we have uh I have done it twice so this is more accurate update status means of a product what does this mean uh great status that is this update status again will come for a unit so that is also another thing that I've done incorrectly Arsenal unit [Music] okay and uh okay this takes care of that order has a map of product to increase your thumb okay this is what we have and user can add a product or they can remove things but they are using the system methods only yes so okay so if a user can so a user will have a instance of system it's like so uh can I make this static so that it becomes important yes okay I have to make all the methods also static so that you can access this okay so the whole uh inventory system is filled with static methods and so this is a Singleton now yes and without creating an instance I can just use its methods so [Music] I need to pass in product details you can have an empty Constructor for now yeah yeah I'll just uh it must be something here that no shortcut nothing no okay generate in that Constructor yeah okay that's perfect yeah okay uh let's say ID so this is this is of course something that will be passed in here as a parameter by the user yes so I can just skip this now this is taken care of there is only one or two things that we need to do one is placing units that is algorithmically something and the other thing that we need to do is we need to make sure that when our order is actually placed uh we can uh that the unit is picked up yes and system automatically updates the location also status also right so you remove unit is not something I have taken care of so uh sorry for that again okay yeah these are two things which are remaining everything else seems to be smooth uh Place unit okay and remove unit Okay so how does the system know which unit should be removed when there is an order placed mm-hmm so how this will happen is yeah in the front end let's look at the front end part of it okay now so now uh so just imagine our Amazon UI okay so you click on a product you see the product details and then you see add to cart button when you click on add to cart button the product moves to the card so this Complete product is moving to the plot now now what will happen next when you place an order so product name would come to you right your product details would come to you so what you can do is you can from the list of products or from the map of the products you can check if there is product availability or not yes yes so users are doing one thing which is adding products or executing orders like you mentioned uh in the order there's going to be some details which will result in the status of the products or the units changing Okay so Execute order is going to be order now inventory system Dot remove unit and this is going to happen for every in order at product count increase set okay um I'm just basically iterating over every single entry in the product account so to make cartons three that that will come over here so I will now take that each entry and then I need to do something I need to remove units for every everyone on this integer item Dot get valued I'll be removing results move unit of this product right item dot get key so when you remove it I cannot save for a particular unit can I explain people something you know there was a question which was asked by someone I don't remember who uh his name but he asked uh will there be many different sort of optimizations or what not something of this WordPress question was so if you uh can you scroll down a little bit where you implemented that function where you search whereas yes so now if you see I want to explain that Ryan to everyone in the audience that every time if you I trade and you will find the product don't you think it has taken too much time here it is taking too much time order of end time complexity would be there yes but but I want to explain or I want to tell to everyone of course uh if an interviewer wants to ask about it he can but he generally he wouldn't ask about it why Point number one uh you have already discussed with me the requirements of everything that is why so he knows that this is the only way to now generate second optimization I'm not looking at your code like I'm not looking at your algorithm I'm looking at how your system interacts different data members could be used uh different data success could be used and that has been checked in your DS and algorithms that if you are able to solve the problem or not right now I just want to see how you are able to build the system how will your front end interact how will your backend handle stuff how will your user handle it that's it so that is why I just just explaining to people yeah absolutely um makes total sense this this is a simple iteration of the whole thing when it comes to executing an order uh our algorithm when it comes to when it comes to uh you know placing a product is probably not optimal also you can probably place it better but for now we are using a very simple algorithm if we want to change the algorithm we can we can see maybe here is a place for strategy pattern so I'll try to implement the strategy pattern here in the simplest possible way let's see if that works so I have two strategies one is uh simple scrap you see so that's one class and another one is smart strategy so the benefit of me doing it this way is I can actually write test cases with simple strategy knowing that this is exactly how things will work and I can write test cases for smart strategy expecting it to behave as good if not better than simple strategy always so this is this is something that we can do okay now let me try to place the units using some method so um first thing I'll do is I will try to get a location which is free lock that location and then set this unit's location ID to that and then I'll unlock that location so okay I'll we go for firstly I need to go to uh location right yeah but now I am I can optimize this but I'm not I'm just iterating over the locations yeah uh keys so [Music] okay if this location is free so I have to have to see in the location map with this location is free but what is the location I'm storing unit okay if this location is empty and I have to pass in uh type of location you know that is not possible that makes no sense because if I've picked it up from location key set then it can't be empty so if location uh is null okay a lot of syntax that is going on sorry for that no worries and I think you can skip it also okay I'm I'm just trying to use the uh algorithm because that is the only thing which is remaining entry Dot get me the value if this is not equal to null then I if this is equal to none other then I can place something here so I'll take a lock on the location so a location yes okay and then once this is done release lock yes and that's it okay so now I've set up the location as this okay so this is this is one way one algorithm I actually should be checking before that only that if the yes size is big enough yeah yeah that I think your algorithm would do right right so you can skip it strategy works yeah I think I'll just I'll just skip this but it's something that algorithm has to do yes okay uh running pretty fast we have remove unit which is for a particular product I will just iterate over the location and units again this is the simple I'll go the basic one it will pick up the first unit of that product type yes then it will just return that as a for that unit so if I say remove this remove one unit of this product iterate over all locations just like we have done over here uh if you get a place where it is not null then check if the unit will take up the product Dot ID matches the product ID of the definitely to get value Dot start writing yeah this this has to match so actually this will be in the if statement and remove yourself this is basically a map got removed uh this location we removed the entry for this location yeah great again I'm releasing the lock yeah only when uh you know after taking a lock here so the next person to come with a lock will see that this entry uh values is no longer none yeah that's that's the so I have not used any uh design pattern here but we can use a strategy design pattern to make this better foreign okay uh any any suggestions uh from you or from the audience I think Robert has a future yeah we can go on the questions uh sure are you reading at all yeah I'll just uh take a few from the audience uh here also unit in products okay uh let me see if there's any interesting question how do you handle when user ad for another one but in the meanwhile added product got out of order okay that's a good question it's a so um in the start Manish we had we had said that every order that we are going through is going to be going uh is going to be sequential uh in this case I we haven't done that okay if you make all orders go sequentially then there is no way that you know concurrently somebody will come and pick it up so that takes care of it but even then in this uh I'm taking a lock on the on the unit on the location and by taking a lock I'm making sure that nobody else can come and pick up this order at the same time okay uh what could happen here well there could be a deadlock there could be something like Arun says there is an order for milk cartons too and I say there's an order for milk cartons too the total number of milk cartons are two Arun goes and while iterating picks up one milk carton at the same time my code also runs whose picks up milk one milk carton and now we are waiting on each other we are locked forever I'm waiting on the other uh one till you know the lock is released that would be a deadlock uh sometimes both orders would fail that would be one way of just reverting the transaction let's say so those are ways in which you can handle this problem if you make everything sequential nothing like it but if you can't make things sequential then you need a way in which you have to lock the items concurrently a set of items concurrently this is not easy and the probably the way you're going to go about doing this is basically trying to acquire all locks if you fail to acquire all the locks within a certain period of time you have to time up so it will be a time lock so on are we allowed to use Frameworks in hld I don't think let's take another question uh Rahul says let's say you have an inventory of groceries the inventory manager is required to throw out the expired items and update the inventory okay this is our item expiring so suppose an external committee wants to show you do not have expired products in the inventory how do you implement this would you prefer creating a new record for each product per day so uh I what I can think of right now just after looking at the question okay this is what happens in an interview um so what we can do is in the product itself in the product itself uh we can have a show in the product class which whatever has made we can have a expiry date also there only okay now every day every day in the morning the system can generate a report uh wherein they can tell me the list of all the units who are expired and then probably we can clean up or whatever so this way we can get a list of all the expired products yeah like when we are deducting or something removing products like we can manually also go and you know maybe the machine went and crush the product by mistake or something happened some cat ate it or there's a snake inside I mean anything can happen so you might want to manually also remove that product so and then go and update the count over there in the system so you can do it for expired products also your machine can go automatically pick those products up it's as good as making an order actually in the morning when it goes to expiry uh take all the products which are expired go to those locations ask the machine to pick and throw it and send them as set them as available okay folks if you have questions you can post them here I think I haven't mentioned it for a while it's on slido I will also just share the question which is already there okay most of us feel like uh less confident when it comes to LED interviews we feel reasonably confident 30 uh and uh four and five percent uh four and five star is really low 14 percent is on two star okay q a I think three of them we have handled already okay how do you handle concurrency if you have to maybe you can just share your thoughts at Uber level I guess we spoke about you know ordering and uh taking locks we also talked about whether there can be a deadlock or something so this I think we have answered to some extent we're going to be answering more of this in the in the course that we are coming up with so if you want to subscribe for that one of the things you can do is just go to interview ready and just sign in if you sign in then we'll at least have a email ID through which we can connect with you and the current course also has machine coding and eyelid design and you know when it comes to system design it's a it's a full course so you can purchase that also the low level design problems like this we are taking next do we have to draw like do we have to draw the LED interview I mean we can just write the class if roughly on ID for discussion only okay yeah uh so uh you can whatever suits you actually whatever suits you whatever uh makes think clear to you and to your interviewer you can go ahead with that make sense okay I would suggest drawing because although you saw that it took us one and a half hours uh to do this whole thing it's not just about so one is our speed was actually higher than it would otherwise I I truly believe had we tried to just go and code the amount of discussion we would go through we would not have been able to do 50 of what we did right now okay uh you can try it at home and see which one works better like by uh it's as good as coding without having reviews just code and then see oh wait requirement or something else so you come back and so there is back and forth there is lots of time very objectively also this is far better as a method second thing is the interviews the interview is not about you writing as much code as possible the interview is about your interviewer understanding what you have done and it's the same with Team discussions and design discussions and everything engineering you have to communicate your thoughts so communicating them is effective when you draw things if you just write code it is okay but it's not good it is okay it is acceptable but it is not good or great so okay detailed view of the entire system okay does the actual LED interview go into the detailed view of the entire system or just a few flows are discussed Arun I think you have mentioned that it can go anywhere it's best to in a in a YouTube video to talk about all of them but in a real interview they'll be like okay yeah let's keep going ahead uh it will be fast how do you scale when map becomes huge uh this you can use a cache and it is cache if required in the real world of course we'll have these libraries and tools over here we just have you know the language we have should we not have a sale table installer report I think there will be more that will be more helpful okay for that we can have an order stable I think sale table orders table the one the same thing uh of course that can help and there could be a number of more ways that can help but that was not in the scope of the interview which we yeah I guess okay uh finally guys we would like your feedback for this video how did you find it just let us know again I'm sharing the link of slido over here how did you like the video did you like it did you did you not like it be very Frank be very honest Arun and I basically the reason why we are doing this is so that you understand how local design interviews work if it's if it needs to be changed it's best to tell us it's totally Anonymous also like who cares right okay so you can give us a rating over here okay the ratings have started coming in I'll I'll reveal them in five minutes till then uh we can take a couple of questions but please feel free to give us your rating if you really liked it of course you can hit the YouTube uh you know like button or LinkedIn like button also why are we not using persistent storage has this question I think to some extent we have answered this we are doing a low level design so high level design will talk about persistent storage uh do we have to show the diagram okay this is foreign manager I have not upscured myself in low level design is it required for managers as well generally the job of an engineering manager is to get things done from the Developers beat anyhow so I don't think but of course uh having knowledge of LED would be great uh engineering Managers generally don't review the pr or they are not the one responsible uh but yeah having a skill is always good okay okay yeah I totally agree uh I don't know whether it will be relevant for you as an engineering manager I don't think it will be if you know it it's good you can talk to them like an engineer but the fact is you're not going to be using it so it's okay it's like does a product manager need to so another question then is what about product managers what about uh ppms technical program managers do they need to know about low level design they do need to know a little bit about high level design they do talk about it devops also but lower design uh so again the the job profile or the work that a product manager has to do is to get features and then ask the engineering teams to work on this right if they can help in Engineering also that is great but I don't think uh product manager needs to learn or he does coding I don't think he does coding okay your view on this yeah see not at all no need to go for Led uh you know Design Round if you want to see then yeah otherwise not at all you don't need paying us money is always we are more than happy to accept it but then it won't help you so yeah if you want to pay just like that then I'll send you my uh PayPal or my paytm number like but if you want if you if you want to invest in a course for yourself as a PM probably somewhere else makes more sense uh who would it make sense for engineers makes a lot of sense throughout your career like from zero to um Architects also Architects also they review code so there is that yes so that's why I don't know up till which point we want to see but at least till 15 years I guess it makes a lot of sense because uh the yeah the senior Engineers also have seen they sometimes do write code yeah so actually their their task is so suppose a new uh thing has been made or a new product you're building which means a completely new repository a completely new uh description for requirements and then you so of course uh as in when the new Engineers come we also want to interact or write in the same report which becomes more and more complex going day by day so this is how the design pattern helps right uh you can have different different directories inside that repo and directory scan up files and later on different directories interact so how does the code is understandable to other Engineers how is the code able to interact amongst themselves or how is no it's not complex that much yeah of course everything is low level design everything is low level design right so uh 15 years or anybody who is writing code or who is building stuff needs to learn needs to know about low level design and it would be good to have so would you say that you know I'm not preparing for my interviews I just want to be a better software engineer do you think this is kind of video will be relevant to somebody's so uh right now this video was just about an interview okay so we would have missed a lot of things we would have covered a few things or we would have covered a lot of things also okay uh but what I am saying is lonely low level design knowing design patterns how to implement them would be great so learning that would be great this video specifically will that help of course it will give them a very really good idea how uh you know our discussions how we went ahead how architecting or making stuff would help because in real world also product manager would come up with a set of requirements you would list them all down then you would go ahead with making the use case diagram then of course you'll meet the class diagram all of that flow would really help so yes it will be valuable to you know watch it also it would be valuable to someone who is preparing for the interviews also but if you want to think that it would give you a full complete uh you know understanding of how low level design Works uh no this video will not fail but yeah our course mode nice one nice plug I I could expect that okay uh Arun how would you rate how much would you rate this uh so of course I would rate it more than four and nothing is perfect so less than five okay somewhere over here let's say four then some place some some improvement is possible okay so that's one vote for from outside the Skin So on average uh the video has been rated 3.8 Stars so there is some improvement that we can do and 3.8 stars is like on zomato maybe just like okay maybe there's a particular dish that I really like so uh thank you for giving us this feedback guys uh there's one person who found it to be a two star video one person who founded to be a three star video seven founded to be four stars including us and one person found it to be a five-star video so that is actually interesting which means there is scope for improvement uh and that is really good I think with someone else also it became 73 what is the average rating do we do a weighted this is accurate 3.4 it doesn't make sense yeah it's less than four it's less than four unless someone else modes it five star then it's not gonna go to but anyway that's it's good it's a place that we can improve on uh if you have any doubts or suggestions you can let us know in the comments below uh you can connect with us on LinkedIn or you can you know connect with us directly on YouTube through the comments um all the best thank you everyone for coming uh someone removed their three star right now so our rating went up yay okay thank you so much for making this possible I will let's catch up next time and uh any any last words famous or not famous not able to think so you can grow up with your short line which you say every time okay yeah guys if you like the video do uh hit the like button if you want to get notifications for further videos like this hit the Subscribe button we'll see you next time take care bye bye guys
Info
Channel: Gaurav Sen
Views: 27,483
Rating: undefined out of 5
Keywords:
Id: T-9s9U28KJM
Channel Id: undefined
Length: 107min 41sec (6461 seconds)
Published: Wed Sep 07 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.