IPA FE Subject A sample Question 15

Topic: Software

A question IPA Japan published in 基本情報技術者試験 科目A サンプル問題 問15, translated into English. ITPEC is based on the same exams.

Same question on ITPEC: Apr 2024 Q14 +1 more

Data is continuously sent for T seconds from the sending task to the receiving task in the diagram below. When the volume of data sent in 1 second is S and the volume of data received in 1 second is R, which of the following is the appropriate relational expression indicating the buffer size L to prevent buffer overflow? Here, the sending task has a higher transfer speed than the receiving task, and there is a sufficient time interval until the start of the next transfer.

Sending taskBuffer size: LReceiving taskSR

Explanation

L ≧ (S − R) × T — during the transfer the buffer fills at the difference between the sending and receiving rates.

Over T seconds the sending task puts S × T into the buffer and the receiving task takes R × T out. Since S > R, the buffer holds (S − R) × T at the end of the transfer, its peak. The buffer must be at least that large; it drains during the interval before the next transfer.

Answer (d)

Why not others:

  • •(a) — R − S is negative because the sender is faster, and "<" points the wrong way
  • •(b) — the right amount, but a buffer smaller than it overflows before the transfer ends
  • •(c) — R − S is negative, so the bound holds for any buffer and prevents nothing

Key rule: A buffer between a fast producer and a slow consumer must hold (production rate − consumption rate) × burst length, and the gap between bursts must be long enough to drain it.

Software · AI-written, may contain errors

This question comes from the past questions IPA Japan publishes, translated into English by ITPEC Practice. ITPEC Practice is an independent study tool and is not affiliated with IPA or ITPEC. See the original paper (PDF) or Report an issue.