Wednesday, October 6, 2021

System Design - Things to focus on

This allows you to demonstrate your

design skill, defend your design choices, and respond to feedback in a constructive manner

An effective system design interview gives strong signals about a

person's ability to collaborate, to work under pressure, and to resolve ambiguity

constructively. The ability to ask good questions is also an essential skill, and many

interviewers specifically look for this skill.


1. Scalable

2. How easy is it to add or change feature 

3. Easy maintenance 

4. Create proper interface for extensibility

5. Which database use - Sql or no Sql 

6. How to optimize query so that multiple calls don't bring the system down.

1. Gather requirements(use case, who is customer, why is this needed etc.)
2. Discuss system constraints (any limitations, what is allowed vs what is not)
3. Do capacity estimation, specifically
- traffic estimation (read request per sec, write requests per sec)
- storage estimation (storage needed to store worth 3 yrs of stored 'object')
- bandwidth estimate (#of bytes/sec system should handle for incoming and outgoing traffic)
- cache estimate (memory needed to cache some of the hot read responses, 80-20 rule)

4. Define System APIs - Rest style mostly (read about Rest vs Soap)
5. Draw top level system diagram (client, web servers, platform, database, worker services)
6. Discuss database design choice (schema, SQL or no-SQL)
7. Perfect your design for a single user -> get a Minimum Viable Product
8. Discuss scaling
- find bottlenecks and single point of failures (put load balancer, caching, replication, Message queues, Asynchronous workers)
9. Test and Review your design (Treat this one as same what you do in coding interview)
- walk through your system and see if we met each customers need
- did we provide APIs for each customer ask
- did we walk over failover scenarios (not just vanilla passing case)
- did we draw system boundaries/or blocks to explain different parts of systems


My Approach to System Design - Blind (teamblind.com)

https://github.com/kilimchoi/engineering-blogs
http://blog.gainlo.co/index.php/category/system-design-interview-questions/
https://github.com/donnemartin/system-design-primer


Designing a URL Shortening service like TinyURL - Grokking the System Design Interview (educative.io)

Designing Instagram - Grokking the System Design Interview (educative.io)


Algo questions to prepare from:


https://leetcode.com/discuss/interview-question/448285/List-of-questions-sorted-by-common-patterns
https://www.educative.io/courses/grokking-the-coding-interview
https://leetcode.com/discuss/general-discussion/458695/dynamic-programming-patterns
https://medium.com/leetcode-patterns
https://www.firecode.io/problems/index

A distributed key-value store is also called a distributed hash table, which distributes keyvalue pairs across many servers. When designing a distributed system, it is important to understand CAP (Consistency, Availability, Partition Tolerance) theorem. CAP theorem CAP theorem states it is impossible for a distributed system to simultaneously provide more than two of these three guarantees: consistency, availability, and partition tolerance. Let us establish a few definitions. Consistency: consistency means all clients see the same data at the same time no matter which node they connect to. Availability: availability means any client which requests data gets a response even if some of the nodes are down. Partition Tolerance: a partition indicates a communication break between two nodes. Partition tolerance means the system continues to operate despite network partitions. 

Gossip protocol works as follows: • Each node maintains a node membership list, which contains member IDs and heartbeat counters. • Each node periodically increments its heartbeat counter. • Each node periodically sends heartbeats to a set of random nodes, which in turn propagate to another set of nodes. • Once nodes receive heartbeats, membership list is updated to the latest info. • If the heartbeat has not increased for more than predefined periods, the member is considered as offline. 


https://pdfcoffee.com/system-design-interview-an-insiders-guidepdf-pdf-free.html?fbclid=IwAR0_1I7i8qEvNfdJjpYgxX42_ncqLDvrU6IcCWr4YnnmtLW15kkZKdlVYXE

No comments:

Post a Comment

Comment!!

Victoria Canada Trip

 Victoria city to do and must have  1. Parliament building  2. Waterfront  3. Mini sea-bus at waterfront  4. Fisherman wharf   5. Museum (op...