Examples Flashcards

1
Q

Design a Sales ranking system by category

A

Basic Design

  1. User only needs to read, updates/datasource are from another service.
  2. 1 API for read directly from DB, 1 service for consume the updates/compute and store the result in to DB.
  3. the ‘another service’ we can assume that it is a API(better than a raw DB)

Improvements:

  1. Too much DB hits, Too much calculation consider using Cache
  2. load balancer/ CDN
  3. more servers
  4. Database scaling (add more/partitioning)
  5. Consider using No SQL
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Design a recipes website for user-input ingredients

A

Key extra point:

  1. Database data model design
  2. How to compute the result from many to many relationship
  3. Would using Nosql help reduce the computation time
  4. check similar question on CCI - system design question 1 find the documents containing the words
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Designing a shorting URL

A
  1. Cacheing - what to cache, how to update cache

2. URL hashing/generating

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

Database model design

A
  1. list all entities/tables
  2. each Entity/table have a PK (***ID)
  3. then add foreign_key(otherID)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

High level design

A

Client
Server - Read API/ WriteAPI / ComputationService
DataStore - database / External API / Disk

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

Other aspect needs to consider

A

Security, Permissions

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

Build a e-retail company from scratch

A
  1. brainstorm main usecase : login, browse, select, pay, order
    Login Service
    Memebership Service
    Inventory Order Processing
  2. Physically
    Database (implementation of Interfaces)
    Domain Services (Interfaces of any ports, so can invoke and usem import domain)
    Application(invoke services, ports, import ports, services) Ports(implementation of Interfaces)
    common login membership inventory order

In Application
Result1 r1 = service1.processRequest(request); - usecase input port

service2.handle(r1) outputport.handle(rl) - usecase output port

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