Code Room
Code reviewHardcr-g076
Subject N plus one queriesLevel Senior–Staff~30 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

Review this JavaScript GraphQL resolver.

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 reviewjavascript
const resolvers = {  Post: {    author: async (post) => {      return await db.users.findById(post.authorId);    },    comments: async (post) => {      return await db.comments.findByPost(post.id);    },  },};// Query: { posts { title author { name } comments { body } } }
Run or narrate your approach, then ask the coach.