DEV Community

Cover image for System Design Interview Questions – Components You Should Know
Fabian Hinsenkamp
Fabian Hinsenkamp

Posted on • Originally published at bigtech.coach

System Design Interview Questions – Components You Should Know

Let's face it - getting into big tech is hard. Especially, system design interview questions are known to be notorious. Designing a distributed system under time pressure isn't easy, especially because this isn't something we can practice in our daily jobs. So it requires dedicated practice to nail those interviews.
If you approach this challenge systematically, it is the first step to learn the different components modern systems consist of.

Luckily, it's a very manageable amount of component types you need to know to sketch out the most common system design questions.

This article is an introduction to these key components. To support you in practicing your system design skills, I created a
Excalidraw component library, you can download for free at the bottom of this article.

Before you start learning about concrete components it's critical to understand that you have four high-level tasks which every system needs to perform. Data needs to be transported, stored, processed, and presented. All components fall into one of those categories:

Contents

Transport Data

Store Data

Processing Data

Get Ready for your System Design Interviews

In your interview, it will be crucial to sketch out the high-level categories and once you are clear about them, fill in the most suitable component.
Let's get started to learn about transporting data.


Transport Data

Any system needs to "transport" data from one component to another, especially in a microservice architecture.
There are three component types, which are essential to design the data transport functionality of your system.

Message Queue

message-queue

A message queue enables asynchronous communications between services so that the sending service does not need to wait for the receiving service’s reply.
Thereby the fault tolerance and resiliency of a system improves.
Message queues are managed by a message broker which implements the pub/sub pattern to simplify the connection of services.
This allows handling a growing number of services by adding them as publishers or subscribers and thereby scale the system dynamically.

What to use it for?

Asynchronous workflows are great for a couple of reasons.
All systems profit from the decoupling of the services they consist of.
It allows for different parts to evolve independently, be written in different languages, and/or be maintained by separated teams.

Use cases that heavily benefit are order and payment processing in an e-commerce or finance setting.
Message brokers’ ability to enhance fault tolerance and guarantee that messages are consumed once and once only makes them a natural choice.

  • Any micro service architecture
  • E-commerce Website (order processing)
  • Trading System (payment processing)

Popular Implementations

Load Balancer

Load Balancer

A load balancer is a component that acts as a reverse proxy and distributes network or application traffic across several servers. It is used to increase the capacity (concurrent users) and reliability of applications.
Once a load of a system increases, load balancers make sure the load is efficiently distributed over the available servers, without individual servers getting jammed.
Load Balancers are a common component required for basically every system which intends to be highly scalable.

What to use it for?

Any system that has multiple instances of the same service and is under high and volatile load. Typically you add them just before any client-facing server.

Popular Implementations

CDN

CDN

A content delivery network (CDN) is a geographically distributed group of servers. It caches all kinds of content at the network edge.

Thanks to the distributed nature of a CDN, it can handle more traffic and withstand hardware failure better than many origin hosting servers.
Thereby, CDNs increase the availability and redundancy of web content. This content includes HTML pages, javascript files, stylesheets, images, and videos.
Today, the majority of web traffic is served through CDNs, as visitors are more and more inclined to click away from a slow-loading site.

What to use it for?

So a CDN should be part of every high-level system diagram you are drawing, which has a client-facing website or -application.

  • E-commerce Website
  • Streaming App
  • Social Network

Popular implementations


Store Data

The capability of persisting data is central to any kind of system.
However, it depends on the kind of data which database is most suitable.
Besides the listed databases some specialized ones are out of the scope for this article.

Key-value Store

Key-value-store

A key-value store is the simplest form of a database management system.
It allows to store pairs of keys and values in memory and retrieve values when a key is known.
The simplicity does make these systems attractive for specific use cases.

What to use it for?

Typically, key-value stores are used to cache small chunks of arbitrary data like strings or objects resulting from database calls, API calls, or page rendering.
Thereby key-value stores help to speed up dynamic web applications by alleviating database load. The performance improvements are especially significant if the database is called very frequently or the system requires remote calls to independent services with high latency.

Popular Implementations

Wide-Column Store

wide-column-store

A wide-column store is a type of NoSQL database.
It uses tables, rows, and columns, but unlike a relational database, the names and format of the columns can vary from row to row in the same table.
You can think of a wide-column store as a two-dimensional key-value store. Many implementations offer advanced features to distribute data across multiple cloud availability zones and scale linearly.
For ACID transactions better stick to relational databases.

What to use it for?

  • E-commerce Website (product catalogs, recommendation engine)
  • Instant Messenger (real-time chat service)
  • Streaming App (user preference engine)

Popular Implementations

Search Engine

search-engine

Search engines are NoSQL database management systems leveraged to search for content in large datasets. You can use search engines for a lot of different use cases: "classical" full-text search, analytics store, auto-completer, spell checker, alerting engine, and as a general-purpose document store.
From a system design perspective, search engine implementations that allow distributed search are especially interesting.

What to use it for?

  • Instant Messenger (chat history search service)
  • Social Network (user search)

Popular Implementations

Relational DB

relational-db

Relational databases are the most common databases. They support a table-oriented data model.
The schema of a table is defined by the table name and a fixed number of attributes with fixed data types.
If you are storing structured information, or information that can be represented in a tabular format, a relational database is your natural choice.
Moreover, it allows atomic, consistent, isolated, and durable (ACID) transactions.

What to use it for?

Almost all kinds of high-level systems do have at least one use case for a relational DB. Some common examples are:

  • E-commerce Website (User service)
  • Ride Sharing App (Ride service)
  • Hotel Booking App (Accommodation service)

Popular Implementations

Data Store

data-store

Classical databases are designed to store information that can be queried and probably aggregated.
However, if you want to store distinct binary data, e.g. audio, video, or text, data storage solutions are the first choice.
There are different implementations of a data store called blob-, file-, block- or object storage.
Each comes with unique properties that I will cover in a separate article.

What to use it for?

Typically data storage solutions are used for systems that handle media files or offer a file system, as an interface to the user.

  • Streaming App (video service)
  • File Storage & Sharing System (file service)
  • Image Board (image service)

Popular Implementations

- Alibaba Object Storage Service

Processing Data

The user value of any system is created by the unique components which are processing data.

Custom Services

custom-services

Custom services are the components in your system where you implement your custom logic.
Depending on your transport and storage components you have a couple of options to implement your custom service.

What to use it for?

Custom services you find in any system.

Popular Implementations


Present Data

The solution sketch for any high-level system design question include some kind of component that presents the result of your efforts to the end user.
This component also might allow a user to interact with your system and trigger a change of the presented data.

Web or Desktop Application

web-or-desktop-app

Most professional software applications provide a central web or desktop interface and sometime a mobile application with an limited feature set for quick interactions commuting.
Github is a good example for such an application.
The typical system design question however, are mostly end-user focused so it's fair to expect web and mobile applications share the full feature set.

What to use it for?

  • File Storage & Sharing System
  • Streaming App
  • Social Media

Popular Implementations

Mobile Application

mobile-app

Native Mobile applications are key for an outstanding user experience for most life-style focused products.
However, mobile development comes with its own challenges like different platforms, limited screen size, less reliable network connectivity, etc.

What to use it for?

  • Ride Sharing
  • Instant Messenger Service
  • App Store

Popular Implementations

Get Ready for your System Design Interviews!

system-design-interview-questions

Knowing your components is great but without practice you will have a hard time in a real interview situation.
To help you with that I created an Excalidraw system design component library!

You can download the library HERE for free!!

Excalidraw allows you to conveniently sketch out your system design and use excalidraw's collaborative feature for peer review and mock interviews!
It's also free and doesn't require any sign-up.

Thanks for reading this article! If you want to get in touch with me,
just connect with me on LinkedInTwitter.

The article was originally post on bigtech.coach

Top comments (0)