Posts

Showing posts from December, 2021

System Design

Load balancer Does only routing and no computing. Hence, it can handle higher traffic.  To avoid single point of failure, have a standby routing server. Standby comes into picture only when main server goes down. Assign the same static IP to passive Standby server. Modern systems can route 1M requests per sec Managing large datasets Vertical scaling - Increasing capacity of server Functional Scaling -  Split data logically like users, purchasing..  Microservices share data to other apis Implemented at Application layer Horizontal scaling Also called as Sharding Split and store single logical database over multiple servers called data nodes Can be implemented at Application layer or DB layer Consistent Hashing Distribution scheme that doesn’t directly depend on number of servers, so that, the number of keys to be redistributed is minimised. Consistent Hashing ring Say 2 hash functions Hs & Hc Hs - Marks servers on consistent hashing ring Hc is used to mark partition ke...

Techniques

Books: cracking the coding interview https://www.interviewbit.com/data-structure-interview-questions/ https://www.interviewbit.com/algorithm-interview-questions/ https://www.interviewbit.com/courses/programming/ https://www.amazon.com/Designing-Data-Intensive-Applications-Reliable-Maintainable/dp/1449373321 Int Max value - 10^9 Long max value - 10^18 -> 19 digits  Interviewbit leetcode GeeksforGeeks Refactoringguru for Java design patterns  Dare2Dream DataStructure Algorithms & Problem solving DataStructures to solve problem very effeciently. Coding -X time & Debug/Testing takes 10-20X time So, coding accuracy will improve productivity Effeciency is money-This differentiates between good and great developers. CS fundamentals OS, DBMS, Networking Design LLD/OOPS design   HLD/System Design Facebook messager 50 Billion messages/day, each message of size 500 Bytes 50B * 500 Bytes = 25000 Billion Bytes = 25000 * 10^9 Bytes = 25K * 1GB = 25 TB Thought process/how to ...