Chapter 15 checkpoint

Sales rank by category

Every question from this chapter’s lessons, grouped by the lesson that teaches it. Answer each one right to finish; you can try again whenever you like.

0 of 17 answered right

15.1 Requirements, estimates and the ranking API

0 of 4 answered right
Open the lesson
Question 1
The service receives 1 billion purchase transactions a month. In a 30-day month, how many transactions per second is that on average?
TPS

Answers within 5% count.

Question 2
Each transaction log line is about 40 bytes, and there are 1 billion a month. How much new data is that per month, in GB?

Answers within 5% count, in any unit you choose.

Question 3
Using 400 requests per second ≈ 1 billion a month, how many reads per second do 100 billion reads a month average out to?
reads/s

Answers within 5% count.

Question 4
The ranking itself, the top 1,000 products in each of 1,000 categories, is only a million rows. So what is actually hard about this feature?

15.2 Stream processing versus batch recomputation

0 of 5 answered right
Open the lesson
Question 5
Why does recomputing the ranking from the raw log in an hourly batch job give trustworthy results?

Question 6
Match each stream-processing term to its meaning.

Question 7
The streaming counts for a window are a little lower than the hourly batch recount of the same window. What is the likely cause?

Question 8
Purchases are weighted by e−λ⋅agee^{-\lambda \cdot \text{age}} with a half-life of 24 hours. How much does a sale from 48 hours ago count?

Answers within 2% count.

Question 9
In Kreps’s Kappa architecture, how do you reprocess data after fixing a bug?

15.3 Redis sorted sets and skip lists

0 of 4 answered right
Open the lesson
Question 10
Why do Redis sorted sets suit a continuously updated leaderboard?

Question 11
You keep the top 1,000 products for each of 10,000 categories in sorted sets. Assuming about 128 bytes per member, how much RAM is that, in GB?

Answers within 5% count, in any unit you choose.

Question 12
How does a Redis skip list decide how many levels a member’s node has?

Question 13
Match each sorted-set command to its cost, for NN members and MM returned.

15.4 Serving reads: caching, hot keys and sharding

0 of 4 answered right
Open the lesson
Question 15
A rarely viewed category gets 0.01 requests per second, with the same 60-second cache. What is its hit ratio, as a percentage?
%

Answers within 2% count.

Question 16
On a big shopping day, millions of shoppers open the Electronics ranking, and all its reads land on the one Redis node that holds it. What relieves that node?

Question 17
A hot category’s writes are split so that each shard holds partial counts for every product. The top 10 is built by merging each shard’s top 10, and sometimes it names the wrong winner. Why?