Front End System Design Flashcards

1
Q

What are the different steps/processes in solving a front end system design question?

A
  1. General/Product Requirements
  2. Functional Requirements
  3. Client Side Architecture
  4. API Design
  5. Data Entities/Data Storage
  6. Optimization
  7. Accessibility
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are common optimization strategies for Network

A
  • use HTTP2 if possible (e.g. allows for multiplexing which enables for multiple requests to be served via one connection)
  • for images, have an image compression service work with the CDN to compress images
  • use webp image format instead of png (use instead for fallback)
  • brotli compress content
  • zip all assets to minimize bundle size
  • use CDN caching to cache all resources and appropriate assets
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are common optimization strategies for Javascript

A
  • Move asynchronous javascript to worker thread/web workers to block render thread
  • Delegate filtering and computationally heavy operations to the server
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are common optimization strategies for rendering

A
  • Use css naming conventions
  • Use css animations (which are more efficient than JS based ones which involve reflow or repainting the browser based on changes)
  • in line critical resources
  • add lazy loading/placeholders
  • optimize DOM perf by using constant nodes and editing node content (as opposed to adding/deleting nodes)
  • mimify assets/code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are common strategies for accessibility

A
  • Keyboard based navigation (based on feature)
  • Usage of rems as opposed to pixel (to fit into particular view)
  • Color schemas available for those with color blindness
  • Screen reader compatibility (aria-live fields)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the pros/cons of long polling

A
Long Polling (simple request in some interval):
Pros: 
* HTTP benefits 
* Simple to implement 
Cons: 
* Latency can be long 
* Connection time outs due to proxies/having to reconnect 
* sending full requests
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the pros/cons of web sockets

A

Pros:

  • allows for a 2 way connection (from client to server, as well as server to client)
  • Very fast

Cons:

  • have to maintain multiple connections for each particular process
  • no HTTP 2 compatibility
  • use constant TCP connection, which is resource expensive
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the pros/cons of Server Side Events

A

Pros:

  • HTTP 2 benefits (scalability, load balancing, asset zipping, caching)
  • contains minimal information (doesn’t contain additional headers)
  • don’t waste device resources
  • easier to load balance

Cons:
* one direction only from server to client

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

Create the front end store for a chat application with contacts, messages, attachments

A

Store Normalized:
contacts: {[cid]: contact}
messages: {[contact id]: messages[]}
attachments{[cid]: attachments[]}

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

Draw dependency tree of a chat app with data flow (consider contact list, chat view, messages, and attachments)

A

Refer to Front End System Design Notes

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

Draw dependency tree of Pinterest with data flow (consider pin, pin details, pin comments, pin feed)

A

refer to Front End System Design Notes

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