While booking seat, using locks at the right level (so that the entire application doesn't get locked), timeout for a lock, asynchronous payment processing is the main reason why this question is usually asked. Identifying the entities are good starting point. 👍
@StockArchives2 жыл бұрын
Hi, Great Video. Some points which i faced or asked to implement - 1) Use of SOLID principle. 2) Core logic of some important class. 3) Extensibiliity for some extra features in future - in this case - Coupons, Offer, Cancellation/Modification for events. 4) Iteraction between some classes. Explaination if possible, a little slow.
@akshaysachan95929 ай бұрын
Were you able to implement all of the requirements considering limited time ? How does the interview perceive that if we are not able to complete everything
@StockArchives8 ай бұрын
@@akshaysachan9592 Two parts here - Need of overall discussion of these kind of topics from person to the interviewer, side along asking interviewer if he or she want to move in that direction. Second Part - It is not important to wholly focus on to give complete solution. but How strong fundamentals were, Discussion of overall ideas and wether interviewer got idea If a person will able complete it, if more time was given. One bonus point - If interviewer is not giving direction, and just listening. It is your job to navigate the solution.
@HarshalDev10 ай бұрын
List seats being a part of Show class and not Audi class -> the explanation and the thought process behind it was amazing. Thank you for clarifying the same
@shahkushal14953 жыл бұрын
@4:27 A better argument could be, when a ticket is booked, it is booked for a particular show. So, in the show, one can have all the seats instantiated, and used.
@duedares4 жыл бұрын
You have amazing communication and a grasp of the topic. I have just one piece of advice: Break it. Break the files and classes. That is all we want. Thank You!
@duedares3 жыл бұрын
Okay spammers, I'll never open flixzone or whatever 😂
@Manikantabomma13 жыл бұрын
Great work Soumyajit.. your LLD videos are the best low level design courses among those I have seen.. Thank you so much..
@praveenkumarr323 жыл бұрын
Overall a great explanation. We shouldn't be spawning out separate classes for each Role (ex:admin) they are going to play, that has to be abstracted out and made as a separate user management module( or access control module). Tight coupling a user with a role is not scalable. often we would like reassign the user a different role so these two should be separate entities and should have a m:n association among them.
@bostonlights27494 жыл бұрын
You have splendid communication skills
@SoumyajitBhattacharyay4 жыл бұрын
Thanks for the feedback!! Really appreciate it!
@ishanshah33093 жыл бұрын
Good video! I specially liked the ending part where you explained how it can be extended to any kind of booking system not just movies. That was really good.
@skannanji2 жыл бұрын
He is definitely a Indian techie monster. Nice tutorial.
@aaaa112683 жыл бұрын
U r helping lot of people to be well prepared for the interviews.Good job and u will get lot of good will
@quirkyquester8 ай бұрын
bro, you make amazing video, can't thank you enough, you have the best OOP interview practice
@unlockyourfinance2 жыл бұрын
I am thinking of switching to a SDE-2 role in a year and wanted to see how LLD looks like. Great video man! I am confident I will be cracking something great in a year! 😇
@HimalayGoyani Жыл бұрын
Have you bro?
@unlockyourfinance Жыл бұрын
@@HimalayGoyani No bro, feeling settled here, I am upskilling according to project requirements, getting good hikes year on year, still I will consider switching if I don't get promoted this year, in SAP Labs now
@divyankgupta4178 Жыл бұрын
@@unlockyourfinance bro don't get too comfortable :)
@mayurkharche90874 жыл бұрын
Thank you for your efforts!!! This is the very first vedio I have seen from you channel, I will surely watch all the vedioes on LLD.
@rahulshetty15673 жыл бұрын
Great video, thanks! 1. What is the general format one should adapt to answer in LLD interview? 2. Are we expected to make Class Diagram and Use case diagram in the beginning? 3. Are we expected to write internal logic of how booking is done, what if booking is full and so on?
@SoumyajitBhattacharyay3 жыл бұрын
It all depends from one round to another, one interviewer to another. In my interviews I had been asked all three types, making classes, APIs functions and their interdependencies, then in some of them was asked to implement it end to end and in some was asked to just implement a couple of functions
@tarungarg3036 Жыл бұрын
felt confident after watching this video.
@grovervishal5913 жыл бұрын
A very good explanation Soumyajit . I really like the extension part which you explained in the end.
@rahulsharma50304 жыл бұрын
Doing great.I would suggest to increase frequency of LLD.
@SoumyajitBhattacharyay4 жыл бұрын
Thanks for the suggestion. Yes i will be uploading the parking lot lld video soon!!
@bhalulal59472 жыл бұрын
@@SoumyajitBhattacharyay I still cannot find more videos on lld
@carpediem94074 жыл бұрын
Today from nowhere youtube suggested me your channel ... was bored .. and just decided to watch for couple of minutes ... but already finished 5 videos 😂😂...Great video bro .. really appreciate your hard work ... I think so ...I will end up watching all your videos by today itself 😂💯💯
@SoumyajitBhattacharyay4 жыл бұрын
Thats super cool! And good to see that the algorithm is picking up some of my videos 😄. Thanks for watching and really appreciate thr feedback!! 😄
@carpediem94074 жыл бұрын
@@SoumyajitBhattacharyay Your low level design skills are god level 💯💯💯💯... plus explanation also . 💯💯
@SoumyajitBhattacharyay4 жыл бұрын
@@carpediem9407 thanks 😄
@tusharrawat87683 жыл бұрын
Great video, Soumyajit. One question though, in interviews they don't ask to implement the reponsibilities of each entity/actor class? If they ask for a working prototype solution, we need to implement all these apis correct, using some in-memory Data-structures. Please make a LLD video where your cover the implementation details of the responsibilties/apis.
@sudheerg91823 жыл бұрын
You can have repository class and we can use maps as our data stores , and we can refer this repository from service class. This will make implementation easy during interviews and works fine.
@VinothiniAnabayan3 жыл бұрын
your low level videos are clear and precise.. Keep making videos..
@munjal555553 жыл бұрын
I am not convinced with using the same design for something other than bookmyshow, it very obvious that both the product might evolve in different ways, and unnecesasry we have to keep an indentifier to track which fields belongs to what product and not foe another product. btw. good explanation
@ShivamVerma-gq2sm2 жыл бұрын
macha diya dada !!! thankyou so much.
@adityasinghaswal49233 жыл бұрын
Straight to the point..brilliant explanation!
@meghadave93633 жыл бұрын
Hi Soumyajit . This is not to devalue your work . but my observation is that most of the lld on this channel or else where are using same set of design patterns like decorator and strategy. i am not finding the designs very elegant . LLds should be about how well are we choosing our design patterns and data structures. Stiil great work . Thanks
@dewanshnigam81292 ай бұрын
You can keep the List in Audi itself and instead of making a Show have a Cinema, it should be having an Audi as an attribute because a show does not play in a Cinema but an Audi. In this way, class Show { .... Audi audi; } and Audi { ... List seats; } you can book a show and check availability of a seat via accessing show -> audi -> seats.
@YogeshDharya-ji9ch7 ай бұрын
Helped me a lot ! thank u so much , gave me the clarity I needed 😇
@dhananajaykrishna82593 жыл бұрын
Awesome!!! Please keep making such videos... It would be of great help,if you start by showing the class diagram and then moving on to the code part.
@vaibhavtandon78212 жыл бұрын
Thanks for the video. The best part is you have coded what you design. Can you also include or talk about the database schema ? That would cover most of the design perspective of the app.
@akashjain41843 жыл бұрын
@Somyajit , IMHO the parent entity should'nt be storing the references to the child entities (Unless they belong to the same aggregate). For example : ShowService and AudiService might be deployed as two separate microservice altogether , in those scheme of things AudiService should not store the reference to the Show, rather Show as a child entity should store the reference (as a client reference id if you will) to Audi entity. Even in case you STILL want to store the reference of child entity with parent it should be just the primary key and not the object. Let me know your thoughts on this!! :) EDIT: Just to explain better , if we will store reference to Shows in Audi entity , this will introduce hard coupling between the two services , Show service going down would mean , I can't even create an Audi!
@PratikShah1233 жыл бұрын
Thanks for the great video..! However one feedback: cityShowMap shouldn't be a part of Movie, as it doesn't seem to be a scalable approach while preserving into DB.
@Shashwatoctober9 ай бұрын
You've created a circular dependency between Show , Cinema & audi. How will toString() work in this case? It will lead to an infinite recursion. Is this correct design or an anti-pattern?
@abhijeetkumar37523 жыл бұрын
best tutorial of low level design with great explanation and also with code...
@SoumyajitBhattacharyay3 жыл бұрын
Thanks so much glad you liked it!
@mwshubham3 жыл бұрын
Thanks for adding additional details of using inheritance to extend this architecture for booking events and other
@mayanksingh-ki1gx4 жыл бұрын
First of all thanks for the efforts. :). One correction. If you are adding searchobj in User Abstract class, then for your admin class you will be breaking liskov substitution rule as for admin it doesnt make sense to have searchobj.
@ViragJainimhere Жыл бұрын
Great efforts and crisp and short video
@DecentProgrammer2 жыл бұрын
Great Video. Keep up the good work going brother.
@rajaryan75662 жыл бұрын
God level explanation
@deeptisharma42412 жыл бұрын
Hi Soumyajit, it very good explanation fro coding front. Can you help to understand the database front also like what all tables , how table hold mappings and more
@sayanghosh22704 жыл бұрын
Hey Soumyajit, I would actually like to see one code with the whole implementation and your thought process.Since sometimes which data structures(list, hashmap) to store information varies while implementing.Thanks!
@rishabhgaurav4 жыл бұрын
Subtle Explanation! Just curious to know where do you learn this stuff from! Just asking though but waiting for your next video in this series.
@whiteboard76413 жыл бұрын
hi, Couple of doubts : 1) why cinemaHall inside show? 2) why price for every seat? 3) how will you implement "public List getMovies(Date date, String city);" in BMSService? I understand theres no single right answer, but would like to know the changes needed for 2 and 3. Thanks
@AkshayKumar-fj9hd3 жыл бұрын
According to my understanding : 1) Even I didn't get any usecase of CinemaHall in show. If you found any let me know. 2) Because seats are of different type defined by SeatType enum. And different type will be having different price. 3) BMSService has List. So in to begin with we can filter out the cinemaHalls on the basis of city in getMovies method. Then on filtered CinemaHalls we can call the CinemaHall's getMovies method. Any different thoughts? I am up for a discussion. :)
@NirmalSingh-jo9wk6 ай бұрын
Most important part of this question is how to avoid long locks while booking payment is going on, or not use lock at all but in that case two users can book same seat, so how to manage that concurrent case.
@dhanashreekamble61974 ай бұрын
Great video 🔥🔥 , I would like to meet you in person !! Great Mannn 🙌👏
@acousticIndie3 жыл бұрын
Thanks, man! this is so helpful and crisp!
@rushikeshkshirsagar11152 жыл бұрын
great video and explanation loved it.... please do the design of Airline/flight booking system.........
@abhijeetbaranwal3 жыл бұрын
Excellent video. Great work 👍
@NitirajSinghRathore Жыл бұрын
Ofcourse a fresher type of answer. No extensibility in the system, just coded the requirements. Cannot add any new type of booking, like what about if I want to book a theatre show, Virtual meeting, party or what ever. Just thinking about that changes every goddanm thing in this design/class. People please get your design reviewed by any person. Low level design does not mean coding the solution. It means you have to decide the design. Please get your solution reviewed before posting on youtube as a good solution. At the end of the video he himself mentioned clearly that he will be changing almost everything of core code, I am not sure how he did not realise this thing and saying we will just change this and this and this and this .. omg.
@priyasrivastava64256 ай бұрын
Very well explained !!
@kamalpreet54814 жыл бұрын
Great Explanation. Keep posting such useful content.
@manvityagi65294 жыл бұрын
Wow! Worthwhile Content, Neat Presentation.
@hariprasadkumbhar8404 жыл бұрын
Nice explanation. Keep doing this. And encourage others.
@dipikagupta78412 жыл бұрын
Very informative. Please design more lld's.
@NithishKumar-se9ev6 ай бұрын
7:45 What is the significance of searchObj in User class?
@Arvindhanarvindinc3 жыл бұрын
Great work man 👏
@asashish9053 жыл бұрын
Loved it... ❤
@rutachaudhari57743 жыл бұрын
Hi, thanks for this playlist. Just stumbled on your channel. Great work
@SoumyajitBhattacharyay3 жыл бұрын
Glad that you liked it! .do subscribe and hit the bell notification so that you remain notified. And don't forget to share with your friends
@mohitojha75143 жыл бұрын
Amazing content, well explained
@prakhar.mishra4 жыл бұрын
How would you make sure that no two users end up booking the same seat?
@amanvikram048 ай бұрын
I think it would have been better if you have just gone through a quick look of requirements, anyways it was great video as i am watching it after 3 years of upload👍
@NehhalKalnadTheGreat414 жыл бұрын
very crisp and perfect vdo 😋
@aakash17633 жыл бұрын
Great video just minor doubt for admin user he can add Show right so when he wants to add Show So he will give us the show object and addShow API will add the Show at the database but this Show will have all the information like at which cinemalhall, of which movie type, timing and on which Audi of the particular cinema this show will be placed.
@aakash17633 жыл бұрын
if I observe carefully there is an API in cinemalhall which gives me the list for particular dates, now when this API will give me list if I get one show object it has all the information of the show at which cinema hall this is available, what is the movie and everything. i am confused like Show has a cinemal hall object and Cinemal Hall has list which internal have list when you try to store show information in the database Show will be a huge object right?
@karun46634 жыл бұрын
can u share resources u used to learn this stuff and btw LLD videos are dope plz post more videos and can un answer the questions for OS u mentioned
@SoumyajitBhattacharyay4 жыл бұрын
Surr definitely i will do that. Thanks for such encouraging feedback! I have a lot more lld videos in pipeline. Stay tuned to watch them!!
@Ranjeetkumar-do5bx4 жыл бұрын
Hi Got some confusion..in CinemaHall class,List audiList one of d field,... then in Audi class,List shows...again in Show class, Cinemahall cinemaHallplayedAt.....its looking like cyclic?..which type of relation it is?............i mean should we define fields in a class as child fields(like for CinemaHall class, List audiList is type of child field)...but in Show class, Cinemahall cinemaHallplayedAt, its looking parent field in a class Show....might my analysis & its looking into cyclic way..
@zmxncbv952 жыл бұрын
I have the same doubt, it should not be cyclic as you can always derive some fields from the associated fields. Got rejected in 1 company because of these mistakes.
@smriti13dhanbad3 жыл бұрын
Thanks for the great video. Is concurrency handling a part of LLD?
@rahulsharma50303 жыл бұрын
CinemaHall getMovie and getShow api ,will probably call database/datastore to fetch details.So isnt it violating SRP here in CinemaHall? I dont see why we need these api, we can have some cinemaManager type of class, that can handle this.That can talk to datastore and fetch results, why would we have this in CinamaHall Class? The way you have movie search class, similarly you should have cinema search.It should do all this stuff. GetMovies in cinema and then filter by data and all apis. These are just data types you defined.Actual interaction is not clear.How would u get List for audi?It has to talk to someone.That thing is missing everywhere
@PrashantArya-prary23 жыл бұрын
Great work
@adildil426011 ай бұрын
CinamaHall class has getMovies method which only based on date why not city?. As its for particulat cinema hall then we shd know for that cinema hall get me all the movies on that date and city right?
@sahildhiman76752 жыл бұрын
@soumyajit great work bro, Amazon Sent me some study material before interview, where your LLD playlist is included for preparation'
@SoumyajitBhattacharyay2 жыл бұрын
Is that so? That's awesome. 😛
@sahildhiman76752 жыл бұрын
@@SoumyajitBhattacharyay yup bro, yes its awesome your work is being recognised and that's how I landed here 😉 keep grinding
@prabhatkumar6242 жыл бұрын
@@sahildhiman7675 can you please share your experience as I am also having interview with amazon
@ngneerin3 жыл бұрын
Inheritance sucks. Composition is the way to go
@samiles1710942 жыл бұрын
hey, I have a question, all these questions that you have solvedm you made the solution as stand alone aplication why haven't you provided a solution as web application, ie. having controller layer and apis and all, in most of the methods that you have defined in your actor clasees would have been residing in service class, and the entities will just be model classes.
@kaushikg19963 жыл бұрын
Great content 👌
@indrakumarreddy66793 жыл бұрын
Great Work! Could you make LLD video of Uber/Ola.
@shubhamsingh69293 жыл бұрын
So, when the admin wants to add a new show for a movie from where will he get the seats list? Ideally, seatList should be in the Audi and in the show class we should just have a list/set of seats which were booked for that show.
@rahulsharma50304 жыл бұрын
Some suggestions:- 1. Movie should not have cityShowMap as its member, however there can be api in Movie to return getShowsByMovie that returns this map.If we want to make search faster, we will look some other stuff if required.I dont see this map as a movie attribute.To improve search we can always see caching and all stuff before making changes at low level for this thing. 2. Similarly audi should not have List of shows. It can expose api to get active show of this audi.Or if we can ,we can have list of active shows instead of shows.But still i would not like to store list of shows with audi.Show can be separate class with audi id and movie id info. Please let me know your thoughts
@SoumyajitBhattacharyay4 жыл бұрын
One thing, since this is from a perspective of LLD in interviews the focus will be to make everything in memory. So any caching technique will not be entertained.
@SoumyajitBhattacharyay4 жыл бұрын
Plus hacing said that think LLD to be a complete in memory implementation. That is the expectation out of these rounds for most use cases. Hence, we need to keep certain attributes in certain classes which makes most sense as per the given constraint. For example a audi should be containing the information for the list of shows that is running as it is specifically the attribute of the audi. As show time etc will vary as per a specific audi! And likewise for all the other things
@rahulsharma50304 жыл бұрын
@@SoumyajitBhattacharyay understood thanks.Since these are open ended questions.I think these are more of a discussions round than a question/answer:).Thanks for you efforts.
@SoumyajitBhattacharyay4 жыл бұрын
Absolutely true. They are extremely open ended. But as a general rule of thumb low level they test strictly Class design/ db design for the corresponding classes and while implementing they generally ask not to rely on db as a source and make a more of an in memory solution. Highlevel on the other hand focuses on all the aspects about creating a robust system that can handle high tps etc.
@rahulsharma50304 жыл бұрын
long discussion.Just one query, you maintained map as i asked above as a private member, then why did not u maintain similar map in cinemaHall Class, instead there you choose to expose api instead of map?Can you explain why?it will clear stuff
@RajatGautamism4 жыл бұрын
Booking object should not contain totalAmount since it is already containing Payment object which have amount inside it ,correct?
@prafulsinghvit3 жыл бұрын
Since you spoke of 'strategy pattern' , how about making a small video on that and linking it here in the description? Thanks!!
@SoumyajitBhattacharyay3 жыл бұрын
Yes absolutely. Not only that all of them I will be making it in an upcoming video series ♥️♥️ Do stay tuned
@revanthmadasu2443 жыл бұрын
great explanation
@biswaMastAadmi2 жыл бұрын
loved it
@sharmilabaskaran73733 жыл бұрын
Do they ask to complete the entire design here with each of the implementation and Main class.
@nutandevjoshi2 жыл бұрын
What is Audi? Its little difficult to understand. The only Audi I know is car. :) Please let us know what is Audi
@joemorgan7889 ай бұрын
Audi means auditorium , in which the movie is shown
@arpitmodani29643 жыл бұрын
I have a doubt here, as Show class is having CinemaHall so this can be derived that this show is running in which cinema but Audi can't be derived here , like on which Audi the particular show is running.
@AkshayKumar-fj9hd3 жыл бұрын
According to my understanding : I don't think we even need the CinemaHall in Show. Audi class has list of shows, so from there we can know which Audi is playing what show and, CinemaHall is having list of Audi, from there we can get other information. Any thoughts?
@Rubal984 жыл бұрын
Great work
@Shashwatoctober9 ай бұрын
What are people saying? How is this a god-level explanation? This has a code smell. It has a circular dependency
@rishibharadwaj79883 жыл бұрын
I would prefer the get methods of different concrete types to be in their own service.
@GauravKawatrakir4 жыл бұрын
One point is left that is concurrency issue while many people booking tickets at the same time.
@SoumyajitBhattacharyay4 жыл бұрын
I had explained the same in some other comment here. Let me find that out snd pin it 😛
@GauravKawatrakir4 жыл бұрын
@@SoumyajitBhattacharyay one more question with LLD videos, we need some explanation or usage of Design patterns n SOLID principles in the LLD videos because not everyone use all design pattern in their porjects.
@believeralways38753 жыл бұрын
Hi Soumyajit, Thanks for this video, it is very helpful. I have one doubt that whether we should start by creating API class first or Entity classes first like (Person, Movie, Show, Screen, Seat) and then build API class. Any input from others will also help.
@nikhilbalachandran21713 жыл бұрын
You should be knowing both. And you can ask this question with the interviewer for which one to start with.
@ritugupta33673 жыл бұрын
How do we decide which method/behavior belong to which class. eg like getMovies() should be part of Movie class or Audi class? why certain list of maps are present in specific classes.
@zmxncbv952 жыл бұрын
@Ritu Gupta, I have the exact question, did you got the answer to your question?
@aaAaa-rq2cj Жыл бұрын
How do u make sure two people wont book same seat
@arkapoddar37273 жыл бұрын
For CinemaHall Class, there should be an IsActive Flag, in case the cinema is going through renovation, or it will be closed.
@TheGreyInsights3 жыл бұрын
Hi Saumyajit, Can we use any Design pattern to improve on the Search part? We have defined 4 types of search in this case. But when we add more EventLocation like a stadium for let's say cricket match, we might need to a Sports wise search and so on. In the Current case, we will need to update and existing class. Can we add somehow add new search functionality just by adding a new class?
@TheGreyInsights3 жыл бұрын
And Thanks for the Great Work Man !!
@rahulsharma50304 жыл бұрын
In booking class,dont you think that Payment paymentObj; and and the parameter passed to makePayment should be of different types?Booking should have PaymentInfo object like txnid,amount etc. and makePayment should accept something like Payment which is credti card/debitcard etc.?
@sanjaytrasy67053 жыл бұрын
Well done 👍
@optimizer_____24203 жыл бұрын
where price thing is done? like showing price of movie
@kaushiknandula2 жыл бұрын
Excellent
@saitejagatadi97112 жыл бұрын
Bro, A small doubt Does LLD mandatory for Frontend Developers/Web Developers also ?
@AchyuthChowdaryDA11 ай бұрын
too good
@Amritanjali4 жыл бұрын
u r great
@vipulgupta39154 жыл бұрын
I think we miss the main requirement. "The system should ensure that no two customers can reserve the same seat"
@SoumyajitBhattacharyay4 жыл бұрын
Thats an implementation level detail and will depend on the underlying architechture. For example if we are using dynamodb as store than we can very well use optimistic locking lock rows while updating hence ensuring no two threads update the same row at the same time. So the one trying to update the row would have to re read the dirty value and would return failure in this case.
@SoumyajitBhattacharyay4 жыл бұрын
On the other hand you can always use inefficient means of synchronising the entire method which is ineffecient and is not used in the industry.
@vipulgupta39154 жыл бұрын
@@SoumyajitBhattacharyay Yeah Soumyajit! But I think if the interviewer is asking me to design BookMyShow or(Ticket Booking System) then he might be really interested in this particular case. Because this is the only case distinguished it from other system design(Concurrency). Also, the same question has been asked from me in 3 Big MNC's(Arcesium, Mastercard,AJIO.com) & they are interested in this particular case only.
@vipulgupta39154 жыл бұрын
@@SoumyajitBhattacharyay We can handle it by any means. We can use transactions in SQL databases to avoid any clashes. For example, if we are using an SQL server we can utilize Transaction Isolation Levels to lock the rows before we update them. (within a transaction, if we read rows we get a write-lock on them so that they can’t be updated by anyone else).
@SoumyajitBhattacharyay4 жыл бұрын
@@vipulgupta3915 true but that would be a system design question and not a class design or low level design. It is more of an implementation based question. It does not have anything to do with class design or api design or db design that we are talking about here. There can be many follow up questions true.