### Basics of System Design

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

memory:-

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.

Storage:-

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.

https://tech.nazarmubeenworks.com/2019/08/calculating-size-of-user-and-cache.html

### Heap implementation in JAVA

In this tutorial we will see all the functionalities of heaps implemented through java language.

package com.problems.heap;publicclassHeapFunctions{//Function to generate maxheapify where root is max than childspublicvoidmaxHeapify(int Arr[],int i,int N){int largest;int left =2*i+1;//left childint right =2*i +2;//right child System.out.println("left"+" "+left); System.out.println("right"+" "+right); System.out.println("Max size"+" "+N);if(left< N && Arr[left]> Arr[i]){ largest = left; System.out.println("largest left"+largest);}else{ largest = i; System.out.println("largest i"+largest);}if(right < N && Arr[right]> Arr[largest]){ largest = right; System.out.println("largest right"+largest);}if(largest != i ){ System.out.println("No largest"+largest); Arr=swap (A…

### 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…