Skip to main content

Basics of System Design

This article is first one from the series of articles dedicated to system design interviews. Here i am going to present the base scenario to consider before starting to solve system design problems.

Questions to ask?

1) what is the number of requests a website will recieve in a day/month/second?
2) what is the amount of memory a website will deal in a day/month/second?
3) what is the number of servers that can accomodate these requests?

To answer this , first we need to remember the below numbers:-

  • 1 million = 10 lakh = 1000000 = 10^6
  • 1 billion = 1000 million = 10^9

  • 1 KB = 1024 B = 10^3
  • 1 MB= 10^6 = 1024 KB
  • 1 GB= 10^9 = 1024 MB
  • 1 TB = 10^12 = 1024 GB

  1. Memory we need to see in Bytes
  2. Requests we need to see in numbers

example :-

suppose a website recieves 100M requests every month then:-

requests per day = request per month /24 = 416700 requests
requests per second = requests per day / (24*3600) = 4.8 requests per second


if we take 20:80 principal where 20 percent is write and 80 percent is read operation. From above example it will be like 100 M requests for write then 400 M is read request.

For each second we are writing 4.8 requests if we consider data to write is 500kb then total data writing of 2400 kb or 2.4 Mb data per second.

For each second we are also reading around 9.6 MB of data. So bandwidth is approximately 12 Mb second.


if we consider for 5 years and 2.4MB of data is written at every second then :-

2.4 MB per second = 207360 MB per day = 207 GB per day= 4.9 TB per month = 59 TB per year = 295 TB for 5 year.

We will go through in detail about 500 kb data that we are writing in next chapters.

So it will be around 295 TB of data. If we consider one machine :-
with win 32 w/NTFS we can store 2TB data ,so total 147 machine we need to store all this data.
With solaris 9/10 we need only 18 machines /( 18 TB in each machine)

we can divide these machines into cache data and db data based upon requirement.

User storage and cache storage is coming up in next tutorial.



Popular posts from this blog

5 books that your college doesn’t tell to read seriously for PLACEMENTS

1.Let us C - It can be the best book to pick in your first semester itself. The book is written in a very simple style so you can easily grasp most of the concepts of programming by just working hard on it. It will help you in building basics of programming around c language.

2.HEAD FIRST JAVA-This book you should buy in third semester and invest your whole second year into it by working on all the codes. This book will help you teaching the concepts in a very attractive way. You will never bore while working  through this book.

3.Data Structure Made Easy In Java - As soon you finished studying core java in the 4th semester just pick this book to understand the logic’s of data structure and algorithms. It will help you to go deep inside this subject from which questions are frequently asked in all the interviews. This book carries a great set of problems that will help in developing intellectual knowledge around algorithms.

4.Cracking The Coding Interview – This book you should start pra…

Bubble Sort in JAVA

What is bubble sort?

It is a sorting technique that is based on the comparison.Here we compare adjacent element, if the first element is larger than the second we swap each other. We do the same procedure again and again until array do not sort completely.

5 1 4 2 8

51428here pass is nothing but iterating the loops equal to number of elements in the array but if it already sorted before then we can break the loop anddo existPASS1 case0 1 //check 0 and first element15428 case1 2 //check 1 and 2 element14528 case2 314258 case3 414258 swap istruePASS2 //first pass completed now do second pass case0 114258 case1 212458 case2 312458 case3 412458 swap istrue PASS3 // third pass case0 112458 case1 212458 case2 312458 case3 412458 swap isfalse since swap is false we break from the loop and do not go for fourth and fifth pass

package sorting;publicclassBubbleSort{//function to print arraypublicstaticvoidprint(int[] arr){for(int i=0;i<=arr.length-1;i++) Syst…