Cracking System Design Interviews — part 1

Chetan Dwarkani
3 min readJul 26, 2022

Let’s slay interviews 🎉

Interviewer: So can you give me an overview on the architecture you would adopt to build a good scalable system design

so do you want the system to be search oriented or it would be mostly on computations such as getting data, performing operations and returning data along with some big data

Interviewer: We’ll go with later. Can you explain me about that

So should I start with high level design or application level design

Interviewer: Let’s go with high level design

Oh Okay, firstly for starters, I would design my project adopting micro-service based event-driven strategy.

Interviewer: Oh can you talk more about that micro-service based event-driven strategy.

I would split my project into multiple autonomous subprojects which are independent of each other. All of them would communicate each other via gateway sub project. All of them will have their independent database which will act as a communication point. Also, I will dockerize my projects so that later when I wanna horizontally scale these individual sub projects, it could be easily done right away.

Interviewer: oh amazing, can you draw a quick picture of what you said

Micro-service Based design

Interviewer: Can you explain a bit more about how would you scale potentially with the above architecture when application load increases

So suppose if our “API microservice” in future starts getting huge number of request then it can be hosted as a new instance and wired via gateway which will simply load balance between these instances. Similar to this, if any of the other sub projects are receiving huge requests then we can adopt the same strategy to scale these dockerized instances. To achieve another level of scaling, we can also adopt clustering in application level where our code base will be deployed in multiple cores within single instance and become more powerful.

Interviewer: Amazing! As and then the project scales how would you manage this then

I will further adopt and wire Kubernetes in this so that we can manage and orchestrate these instances very well.

Next, I would setup an active and passive load balance configuration which will be wired and connected to gateway service. This active/passive LB will help in avoiding un-necessary single point of failure flow.

Interviewer: Amazing — can you draw a quick picture of this overall architecture design

Here, you go

so basically all of my components would be scalable to a great way, everything is dockerized and also I forgot to mention, I would go with a CI/CD pipeline in order to ensure that in future we bring in continous integration and delivery mechanism

Interviewer: What about logs ?

For logs, As you can see in image, I will develop another sub project which would further store this log information in elastic DB. This will be wired in via gateway micro-service since that will act like an entry point for my overall project.

Interviewer: Can you talk about DBs, which framework you would select and why?

For this question on which DB to select and why based on CAP theorem is explained well in one of my separate blog I made. Please go through the below blog to understand about it: Link to the blog (click here)

Interviewer: That’s great!

You can study in depth about these topic more in-depth through my youtube channel where I am practically coding this architecture out

My other medium blogs

--

--

Chetan Dwarkani

Tech experience in System Design | Java Script Framework | Android framework | ReactJS | JAVA | DB Design | chetandwarkani.com