CS FundamentalsHardProduct-company placement · system design
A producer emits 10,000 events per second into a stream whose consumer can process 2,000 per second. Which reactive-streams mechanism lets the consumer stop the producer overwhelming it?
- A. Backpressure, where the consumer signals how many items it can take
- B. Retry with exponential backoff on the producer
- C. A circuit breaker on the consumer that opens when it is busy
- D. Idempotent consumers that ignore duplicates
Correct answer: A. Backpressure, where the consumer signals how many items it can take
Backpressure makes demand flow upstream (request(n)), so the producer slows, buffers or drops by policy instead of filling the consumer's memory. The other options deal with failures or duplicates, not rate.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A table of user events is sharded by event date, and all writes for today land on one shard, which is overloaded while others sit idle…
- Match each cost-of-quality category with an example. P. Prevention Q. Appraisal R. Internal failure S. External failure 1. Reworking a…
- An inspection of 500 delivered forms finds 25 defects, and each form has 10 opportunities for a defect. What is the…
- What value does this Command pattern code print? python v = [0] class Add: def init(s, n): s.n = n def do(s): v[0] += s.n def undo(s)…
- Counting each if, while and conditional expression as one decision (V(G) = decisions + 1), what is the cyclomatic complexity of g, and…
- Module ownership: A is known by Ravi and Sita, B by Sita and Aman, C by Aman and Ravi, D by Ravi and Joe. The bus factor is the fewest…