/
architecture.txt
61 lines (50 loc) · 922 Bytes
/
architecture.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
You want to build an API which returns a data about all the restaurants in a state.
How would you handle requests?
How long does it take to reply?
What modules or patterns would you use to manage the dependencies?
Diagram the network traffic on a whiteboard.
One day the service is 100ms slower, how do you find out why?
http://my-api/?state=CA
Restaurant API gives data about restaurants
200ms
http://restaurant-api/?state=CA
[
{
id: 1,
name: "Bobs Burgers",
cityId: 20,
cuisineId: 30
},
{
id: 2,
name: "Joes Burrito Barn",
cityId: 21,
cuisineId: 30
}
]
City API gives data about cities
100ms
http://city-api/?ids=20,21
[
{
id: 20,
name: "San Francisco"
},
{
id: 21,
name: "Oakland"
}
]
Cuisine API gives data about cuisines
50ms
http://cuisine-api/?ids=30,31
[
{
id: 30,
name: "Burgers"
},
{
id: 30,
name: "Burritos"
}
]