One topic I've been thinking about for the last little bit is System Design. Throughout my informational interviews, I've gotten little tidbits of information to help me prepare for the interview process' at said company. One of these bits of information pertained to system design often phrased in the manner of "be prepared to architect Twitter or FaceBook."
What is Systems Design?
According to the University of Waterloo: Systems design is identified as the philosophy, methods, and approaches to solving problems that are intrinsically multi-disciplinary. Through the consideration of the objective and subjective performance requirements, a design solution is constructed to meet the needs of the customer, the user, and society. Some of the main tools include strategies, procedures, and techniques that help in architecting a specific product or project.
Main Steps
Step 1: Understand the goals of the design
Ask clarifying questions to eliminate ambiguity with the interviewer. Who are the users? What is its primary purpose? How will it be used? What are the likely inputs and outputs?
Step 2:Establish the scope of the project
Now that basic understanding has been established, this is a good opportunity to ask questions about the features of the application. It's imperative that what you are suggesting is along the lines with what the interviewer wants before you move forward. What type of clients does this application want to support(mobile, web, etc)? Are we requiring authentication? Do we want to incorporate analytics? Are we integrating with existing systems?
Step 3: Design for the appropriate scale
We need to determine the scale to gauge if our data is compatible and can fit on one machine. What is the read-to-write ratio? How many simultaneous requests should we expect? Average response time? Limit on data we allow users to provide?
Step 4: Start from a high-level perspective, then get into the nitty-gritty
Begin with the end-to-end processes determined from the goals set in step 1. This might cover APIs, backend services, network architecture, data stores, outlining different clients, etc. and how they all join together to meet the requirements of those stated goals. This is where the conversation will end up covering potential performance bottlenecks and decisions about the delegation of responsibilities. Whatever way you approach this step, remember to start simple and build it out from there.
Step 5: DS&A - Data Structures and Algorithms
Runtime and memory complexity are super important in designing software systems. The efficiency and usability of the application (depending on the scale of the project) are completely dependent on a deep understanding and implementation of DS&A.
Step 6: Tradeoffs
Just about every decision you make will have trade-offs. It's important to be able to talk about them in real-time, offer solutions for them and demonstrate that you are aware of the complexities of systems and how they often require compromise and showcase your understanding through the pros and cons of each approach. Remember, there is no correct answer, just be prepared to explain yourself to show the interviewer that you're logical and will use the appropriate tools to get the job done.
The Process
This can be broken down into four main compartments and are best illustrated by this image:
- task definition
- conceptual stage
- design stage
- implementation stage
Basic Examples
For the example portion, I am going to keep it simple and stick to Twitter and showcase some smaller examples. As I'm sure you know by now, architecting an entire social media page would be quite extensive and this goes back to step 2 of the Main Steps portion of this blog and establishing the scope. Remember to ask lots of questions so you aren't diving deeper than you need to and wasting interview time.
In this first example, I am using a diagram showcasing how to design Twitters REST API:
https://www.visual-paradigm.com/tutorials/rest-api-design-twitter-example.jsp
I hope this blog post gave you some clarity on the subject and a better understanding of how to tackle this prompt next time you encounter it.
Good luck!
Top comments (11)
Awesome article, Sofia! I started learning more about System Design, especially Distributed Systems. At my current job, I am not really required to know System Design, but it's major kudos points to know and contribute to products in such an important way. I think it's really important for every Software Engineer/Developer to learn it!
I found this article to be a really good resource when I started learning!
Scalable Web Architecture and Distributed Systems by Kate Matsudaira
aosabook.org/en/distsys.html
That's such a helpful and thorough article, thank you for linking it!
@sofia, I thought you would describe software development life cycle (SDLC) as shown in first image. But when I read this article I found it very interesting, thanks and you rocked in this post.
Suggestion : edit image of you think it should not be SDLC
Woow; indeed. Thank you so much for ur dedication and contributions.
Wow, great article, thank you!!!
System design is not the same as a design system FYI.i day this because I believe your cover image is misleading
Valid point.. Thanks for pointing it out, I replaced it with something more fitting!
Very cool. Do you have a higher res version of the full object model? It's really nice to see these all mocked out.
Thanks Abe! Unfortunately, I don't.. If you really wanted to dive deeper into it you could download the project file from the link: visual-paradigm.com/tutorials/rest.... Otherwise if you look into it, this tutorial goes all the way into the nitty-gritty and shows you everything in pieces!
This was a nice read. Do you have any recommendation on software to help create these diagrams other than Visual Paradigm? (seems like it might be a bit bloated for me)
Absolutely! There are so many free resources out there. I've used lucidchart.com and draw.io in the past and find that they're pretty smooth.