https://github.com/tonyvu2014/design-questions
Object-Oriented and System Design Question Analysis and Implementation
https://github.com/tonyvu2014/design-questions
interview-questions java oop system-design
Last synced: 24 days ago
JSON representation
Object-Oriented and System Design Question Analysis and Implementation
- Host: GitHub
- URL: https://github.com/tonyvu2014/design-questions
- Owner: tonyvu2014
- License: mit
- Created: 2017-12-19T05:34:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-07T00:01:25.000Z (over 8 years ago)
- Last Synced: 2025-12-08T03:54:31.767Z (6 months ago)
- Topics: interview-questions, java, oop, system-design
- Language: Java
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# design-questions
Object-Oriented and System Design Question Analysis and Implementation.
This repo to give analysis and detailed implementations for some of the sample design questions in Java.
## Steps
From my experience, the steps to follow when you are asked a design question are:
1. Ask questions to clarify about the requirements. The few things that you probably want to be clear about are:
- What are the use cases that are suppported?
- How many users the system is going to support? (especially for system design question)
- Definitions and terms that are clear
2. Come up with list of entities
The rule of thumbs to remember is that trying to map to real-life objects as much as possible. For this steps, just list down the entities first without the properties and methods. Make this step quick.
3. Add properties and methods to entitites
To save time, you probably want to ignore trivial like contructors or getters and setters. Also try to to come up correct relationships betweem entities, either one-to-one, one-to-many or many-to-many. Many-to-Many relationship is normally modeled with an immediate entity class. Again make this step quick.
4. Refine the design with abstraction, interface or design patterns.
Make sure that you know the differences between abstract class and interface and also know when you make use of common design patterns like Factory, Singleton, Builder, Strategy. An easier way to look at this is that: if there are something that you need to do more than once, there is a chance for refinement.
Remember to clarify why you use abstract class, interface or a design pattern.
5. Scaling
Now this is when you apply your knowlege about cache, load balancer, database replication, partitioning and sharding to make sure that the system can handle
high traffic. That's why the question about the number of users at the beginning.
Draw the diagram on the paper, board or on the page. Do not forget to mention about the pros and cons of your design.