Debug and extend a REST API with AI assistance

Quick Overview

You are given a multi-file Node.js REST API with several bugs and a feature request. Using AI coding tools, identify and fix the bugs, then implement the new feature. Meta evaluates your ability to verify AI-generated code, not just prompt it.

Meta
Software Engineering Fundamentals
Software Engineer
Meta
Software Engineer
Onsite
Software Engineering Fundamentals
Medium

0


You are given a multi-file Node.js REST API with several bugs and a feature request. Using AI coding tools, identify and fix the bugs, then implement the new feature. Meta evaluates your ability to verify AI-generated code, not just prompt it.

Meta's AI-assisted coding round gives you a realistic multi-file codebase and lets you use an AI assistant, so the signal is how well you direct and verify it. The interviewer watches whether you read the code, reproduce bugs, test the assistant's suggestions, and keep the design clean while adding the feature.

What the Interviewer Expects
  • Read the codebase and reproduce each bug before asking the AI for fixes
  • Review AI-generated changes critically and reject wrong or unsafe ones
  • Add or run tests that prove each fix and the new feature
  • Keep endpoints cohesive with consistent validation and error handling
  • Explain trade-offs and communicate your reasoning while working
Key Topics to Cover
Debugging
REST API design
Code review of AI output
Testing
Error handling
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • How did you confirm the AI's fix addressed the root cause and not just the symptom?
  • What would you test before shipping the new endpoint?
  • How would you make the feature idempotent for retried requests?
  • What part of this task would you not delegate to the AI, and why?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Core Design Principles

In addressing the bugs and feature request for the REST API at Meta, the core design principles to focus on include:

  1. Separation of Concerns: Each endpoint should handle its own logic and not i...
Architecture

The architectural approach for the Node.js REST API at Meta should leverage a microservices-style architecture, enabling modularization and scalability. The system can be broken down into the followin...


Submit Your Answer
Markdown supported