CS FundamentalsHardProduct-company system-design interview

A cache answers 90% of reads in 2 ms; on a miss the read takes 50 ms in total (cache check plus database). What is the average read latency, and what would it be at a 99% hit ratio?

  1. A. 6.8 ms and 2.48 ms
  2. B. 26 ms and 2.48 ms
  3. C. 6.8 ms and 2.0 ms
  4. D. 5.0 ms and 0.5 ms

Correct answer: A. 6.8 ms and 2.48 ms

0.9 x 2 + 0.1 x 50 = 6.8 ms; at 99%: 0.99 x 2 + 0.01 x 50 = 2.48 ms. A few points of hit ratio matter a lot because misses are 25 times slower.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic