Skip to content
Embercode
✕
How the Internet WorksQuick quiz

Latency math

6 questions. Covers Latency, bandwidth and round trips.

Questions 1 to 5 of 6

  1. 1. Predict the output of this code. ``python def page_time_ms(round_trips, rtt_ms, total_bytes, mbps): transfer_ms = total_bytes * 8 / (mbps * 1_000_000) * 1000 return round_trips * rtt_ms + transfer_ms print(f"{page_time_ms(40, 50, 40 * 2048, 10):.1f} ms") `` What does the last line print?
  2. 2. A page loads 40 small files one after another. The round-trip time is 50 ms. Which single change saves the most time?
  3. 3. In the formula total time = round trips × RTT + bits ÷ bandwidth, the first part measures what? Answer with one word.

    Type your answer.

  4. 4. Predict the output of this code. ``python import math rtt = 90 files = 12 batch = 4 print(math.ceil(files / batch) * rtt, "ms in batches") print(files * rtt, "ms one at a time") `` What do the two lines print?
  5. 5. How long does one round trip take, compared with the one-way latency?

5 question(s) left on this page.

Typed answers ignore extra spaces and, for most questions, capital letters.