Code Room
Code reviewMediumcr-g603
Subject Socket accept no timeoutLevel Mid–Senior~20 minCommon in Networking & APIs interviewsIndustries Software development, Telecom

Question

Review this C server loop that accepts and handles one client at a time.

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.

Talk through your review
Code to reviewc
for (;;) {    int cfd = accept(lfd, NULL, NULL);    char buf[1024];    ssize_t n = read(cfd, buf, sizeof(buf));    process(buf, n);    close(cfd);}
Run or narrate your approach, then ask the coach.