CS FundamentalsHardProduct-company system-design interview
A single-page app makes 30 sequential API calls to render a dashboard, each taking about 40 ms of network round trip. The team cannot speed up the server. Which change cuts load time the most?
- A. Compress each response
- B. Add more server instances
- C. Shorten log messages
- D. Batch the calls into one aggregate endpoint (or run independent calls in parallel), removing most of the 30 x 40 ms = 1.2 s of serial round-trip latency
Correct answer: D. Batch the calls into one aggregate endpoint (or run independent calls in parallel), removing most of the 30 x 40 ms = 1.2 s of serial round-trip latency
With sequential calls, latency adds up: 1.2 s in round trips alone. Batching or parallelising independent requests attacks that directly; compression and more servers don't reduce the round-trip count.
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 Scrum team's velocity over 6 sprints was 20, 22, 35, 21, 23 and 19 points; sprint 3 included a one-off batch of over-estimated stories…
- An enterprise service-level agreement promises 99.95% monthly availability with service credits, the internal SLO is 99.99%, and the…
- A team makes 'Developers must not deploy on Fridays' a rule after two weekend outages. A senior engineer argues the rule treats the…
- A brand-new repository's first commit contains a.txt (content 'hello'), src/b.txt and src/c.txt, where b.txt and c.txt have identical…
- In a hexagonal (ports-and-adapters) architecture, the order-processing core defines an interface OrderRepository, implemented by a…
- A module handleIO(kind, data) contains one big switch: kind 1 reads from the keyboard, kind 2 writes a file, kind 3 sends a network…