Cheatsheet Flashcards

1
Q
  1. Clarify and agree on the scope of the system
A

User cases(description of sequences of events that, taken together, lead to a system doing something useful) Who is going to use it? How are they going to use it?

Constraints/Traffic
1. requests per second
2. read/write ratios
3. Data storage
Special system requirements such as multi-threading, read or write oriented.

Assumptions (can always be solved later)

  1. Assume data source are there
  2. Assume some service are there
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
  1. High level architecture design (Abstract design)
A

Sketch the important components and connections between them, but don’t go into some details.

  1. Application service layer(serves the requests) - List different services required
  2. Data Storage layer
Usually a scalable system includes (WSDC)
webserver (load balancer),
service (service partition),
database (master/slave database cluster)
caching systems.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  1. Component Design
A
  • Component + specific APIs required for each of them. - Object oriented design for functionalities.
  • Map features to modules: One scenario for one module.
  • Consider the relationships among modules:
    1. Certain functions must have unique instance (Singletons) 2.Core object can be made up of many other objects (composition). 3.One object is another object (inheritance)
  • Database schema design
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
  1. Understanding Bottlenecks
A
  1. Too less servers(for too many users)
  2. Too many data
  3. Too many DB access/expensive computation - cache/pre compute
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  1. Scaling your abstract design
A

Vertical scaling
You scale by adding more power (CPU, RAM) to your existing machine.

Horizontal scaling
You scale by adding more machines into your pool of resources.

Caching
- Load balancing Caching - CDN
- Application caching (In-memory)
    Precalculating results
    Pre-generating expensive indexes
    Frequently accessed DB data
- Database caching tends to be "free". When you flip your database on, you're going to get some level of default configuration which will provide some degree of caching and performance. Those initial settings will be optimized for a generic usecase, and by tweaking them to your system's access patterns you can generally squeeze a great deal of performance improvement.

Load balancing/Reverse proxcy

Database replication
Master-slave
Master-Master

Database partitioning
Functional partitioning
sharding

Map-Reduce

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Key topics for designing a system

A
  1. Concurrency
    Do you understand threads, deadlock, and starvation? Do you know how to parallelize algorithms? Do you understand consistency and coherence?
  2. Networking
    Do you roughly understand IPC and TCP/IP? Do you know the difference between throughput and latency, and when each is the relevant factor?
  3. Abstraction
    You should understand the systems you’re building upon. Do you know roughly how an OS, file system, and database work? Do you know about the various levels of caching in a modern OS?
  4. Real-World Performance
    You should be familiar with the speed of everything your computer can do, including the relative performance of RAM, disk, SSD and your network.
  5. Estimation
    Estimation, especially in the form of a back-of-the-envelope calculation, is important because it helps you narrow down the list of possible solutions to only the ones that are feasible. Then you have only a few prototypes or micro-benchmarks to write.
  6. Availability & Reliability
    Are you thinking about how things can fail, especially in a distributed environment? Do know how to design a system to cope with network failures? Do you understand durability?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Web App System design considerations:

A
  1. Security (CORS)
  2. Using CDN
    A content delivery network (CDN) is a system of distributed servers (network) that deliver webpages and other Web content to a user based on the geographic locations of the user, the origin of the webpage and a content delivery server.
    This service is effective in speeding the delivery of content of websites with high traffic and websites that have global reach. The closer the CDN server is to the user geographically, the faster the content will be delivered to the user.
    CDNs also provide protection from large surges in traffic.
  3. Full Text Search
    Using Sphinx/Lucene/Solr - which achieve fast search responses because, instead of searching the text directly, it searches an index instead.
  4. Offline support/Progressive enhancement
    Service Workers
  5. Web Workers
  6. Server Side rendering
  7. Asynchronous loading of assets (Lazy load items)
    8.Minimizing netwrok requests (Http2 + bundling/sprites etc)
    9.Developer productivity/Tooling
    10.Accessibility
  8. Internationalization
  9. Responsive design
  10. Browser compatibility
How well did you know this?
1
Not at all
2
3
4
5
Perfectly