Parking Lot Design | Object Oriented Design Interview Question
Design Amazon / Flipkart: build an online shopping platform
An interviewer will be looking for the basic functionality of necessary features like signup and logic. They will also be assessing the following:
10. What does it mean to override a method?
When you create a class that inherits from another class, you can override the parent class’ methods. For example, if the parent Animal class contains the method move(), a child class such as Bird can either inherit the move() functionality from the parent or override it to something more specific to birds. If overriding is done, then the bird will have its own implementation for the move() method in its own class rather than inheriting the parent class Animal’s generic move behavior.
Exception handling is a process used to trap the errors that can occur when your application is running. It allows users to continue using the software and gracefully handle issues rather than letting the application crash. For example, your browser application doesn’t crash if you lose connectivity to the internet. It just says “retry connecting” or something similar. This is an example of exception handling done correctly in the software. Exception handling is done to capture error scenarios that are outside of the developer’s control.
How to approach OOD interview questions
When it comes to Object Oriented Design interview questions, interviewers are trying to assess your nuanced understanding of complex problems and how you transform requirements into comprehensible classes and subclasses.
OOD questions generally follow similar patterns. During the job interview, you will be given a vague design problem and a set of constraints. Then, you need to leverage your design skills to figure out the “level” of solution that the interviewer is looking for.
You need to think about what functionality is needed and come up with a workable using design principles and a programming language of your choice.
Interviewers care most about the right balance between a solution that works immediately that is adaptable and flexible to change in the future. To simplify things, you can take the following approach for any OOD question you encounter:
Now we will go over the top questions that I’d recommend practicing. I will also share some pointers about the main things an interviewer is looking for in your answers throughout the interview process.