CS FundamentalsVery hardProduct company interview · GATE level
A leaky bucket holds at most 5 packets. In each clock tick, newly arrived packets are first placed in the bucket (those that do not fit are dropped), and then up to 2 packets are sent. The bucket starts empty and the arrivals in ticks 1 to 6 are 4, 5, 0, 6, 1 and 3 packets. After tick 6, how many packets have been dropped and how many are still waiting in the bucket?
- A. 4 dropped; 3 waiting
- B. 2 dropped; 5 waiting
- C. 4 dropped; 5 waiting
- D. 7 dropped; 0 waiting
Correct answer: A. 4 dropped; 3 waiting
Tick 1: 4 in, send 2, 2 left. Tick 2: 2 + 5 = 7, two dropped, 5 held, send 2, 3 left. Tick 3: no arrivals, send 2, 1 left. Tick 4: 1 + 6 = 7, two dropped, send 2, 3 left. Tick 5: 3 + 1 = 4, send 2, 2 left. Tick 6: 2 + 3 = 5 fits exactly, send 2, 3 left. Total dropped 4, with 3 waiting. Check: 19 arrived = 12 sent + 4 dropped + 3 waiting. Reporting 5 waiting forgets the send in tick 6.
More Computer Networks questions
- A browser with nothing cached fetches a page made of a base HTML file and 9 small images, all on one server. Resolving the server's name…
- For the host 172.29.115.201/21, what is the directed broadcast address of its subnet and how many usable host addresses does the subnet…
- The block 10.0.0.0/8 is cut into /19 subnets numbered 0, 1, 2, … in address order (subnet 0 is 10.0.0.0/19). What is the network address…
- A router's forwarding table holds 131.16.0.0/12 → R1, 131.28.0.0/14 → R2, 131.30.0.0/15 → R3, 131.30.128.0/17 → R4 and a default route →…
- A router must summarise 198.51.96.0/21, 198.51.104.0/22 and 198.51.110.0/23 into the smallest single prefix. Which prefix is it, and how…
- 192.168.40.0/24 is split with VLSM, largest requirement first, each at the lowest free aligned address, for LANs needing 60, 28 and 12…