Code RoomIndependent requests serialized
MediumPrep Room Coding #1929

Independent requests serialized

Code reviewDistributed systemsMid–Senior~18 min

Review this JavaScript function that loads several independent resources for a page. It's slower than expected.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix, specific and kind.

0:00 of about 18 min
Mark a line and say what kind of problem it is.0 findings
1async function loadPage(userId) {
2 const profile = await fetchProfile(userId);
3 const orders = await fetchOrders(userId);
4 const recs = await fetchRecommendations(userId);
5 const notices = await fetchNotices(userId);
6 return { profile, orders, recs, notices };
7}
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.