Code Room
Code reviewHard
Question
Review this SQL-backed feed pagination (page is 1-based, page_size = 50). The query is regenerated per request; `$1` = feed_id, `$2` = page number from the client.
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.
Learn the concepts
-- ordered by recency; an index exists on posts(feed_id, created)SELECT p.id, p.body, p.created, u.handle AS authorFROM posts pJOIN users u ON u.id = p.author_idWHERE p.feed_id = $1 AND p.deleted_at IS NULLORDER BY p.created DESCLIMIT 50OFFSET ($2 - 1) * 50;Run or narrate your approach, then ask the coach.