🌍 freeCodeCamp · flashcards

freeCodeCamp Back End Development and APIs Flashcards

50 question-and-answer cards covering Back End Development and APIs as it is examined in freeCodeCamp. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.

50Cards in deck
24Free preview
17Syllabus topics
~206Chars per answer
FreePrice

24 sample cards from the Back End Development and APIs deck

Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.

  1. What does CRUD stand for, and which Mongoose methods commonly implement each operation?

    Create, Read, Update, Delete. Create: document.save() or Model.create(); Read: Model.find(), findOne(), findById(); Update: Model.findByIdAndUpdate() or findOneAndUpdate(); Delete: Model.findByIdAndDelete()/findByIdAndRemove() or Model.deleteMany().

  2. In Mongoose, what is the difference between Model.find(), Model.findOne(), and Model.findById()?

    find() returns an array of all documents matching the filter; findOne() returns only the first matching document (or null); findById(id) is shorthand for findOne({ _id: id }) and returns the single document with that _id.

  3. When using Model.findByIdAndUpdate() in Mongoose, what option must you pass to receive the updated document instead of the original?

    { new: true }. By default findByIdAndUpdate returns the document as it was before the update; new: true makes it return the modified document.

  4. How do you build a chained Mongoose query that finds people who like burritos, sorts by name, limits to 2 results, and hides the age field?

    Person.find({ favoriteFoods: 'burrito' }).sort({ name: 1 }).limit(2).select('-age').exec(callback) — chaining builds the query, and exec() (or await) runs it. In sort(), 1 means ascending and -1 descending.

  5. What is a RESTful API?

    An API following REST (Representational State Transfer) conventions: resources are identified by URLs, standard HTTP methods (GET, POST, PUT/PATCH, DELETE) express operations on them, requests are stateless, and responses commonly use JSON.

  6. Match the four main HTTP methods to their CRUD operations and state their key properties.

    POST → Create (not idempotent); GET → Read (safe and idempotent, no body changes); PUT/PATCH → Update (PUT replaces the whole resource and is idempotent, PATCH modifies part of it); DELETE → Delete (idempotent).

  7. What does it mean that HTTP/REST is "stateless"?

    Each request must contain all information the server needs to handle it; the server stores no client session context between requests, so any request can be understood in isolation.

  8. What do the HTTP status code classes 2xx, 3xx, 4xx, and 5xx indicate, and what do 200, 201, 404, and 500 specifically mean?

    2xx = success, 3xx = redirection, 4xx = client error, 5xx = server error. 200 OK = successful request, 201 Created = resource created, 404 Not Found = resource doesn't exist, 500 Internal Server Error = server-side failure.

  9. How do you send a JSON response in Express, and what header does it set?

    res.json(object) serializes the JavaScript object to JSON and sends it with the Content-Type header set to application/json; e.g., res.json({ message: 'Hello json' }).

  10. In a Node/Express app, what is "request parsing" and which req properties hold the parsed pieces of a request?

    Extracting structured data from an incoming HTTP request: req.params for route path segments, req.query for the query string, req.body for the parsed body (requires body-parsing middleware), req.headers for HTTP headers, and req.ip for the client's IP address.

  11. Timestamp Microservice: given a valid date, what JSON must the API return for GET /api/:date?

    { unix: <milliseconds since Unix epoch as a Number>, utc: <date as a UTC string, e.g. "Thu, 01 Jan 1970 00:00:00 GMT"> } — unix comes from date.getTime() and utc from date.toUTCString().

  12. Timestamp Microservice: how must the API behave for an empty date parameter and for an invalid date?

    An empty /api/ request returns the current time in the same { unix, utc } format; an invalid date (where new Date(input) yields Invalid Date) returns { error: "Invalid Date" }.

  13. Timestamp Microservice: why must a numeric date parameter like "1451001600000" be handled specially before passing it to new Date()?

    Because new Date("1451001600000") on a string treats it as a date string and fails, while a Unix timestamp must be passed as a Number of milliseconds: new Date(parseInt(param)). Code typically checks /^\d+$/ to decide.

  14. What is the Unix epoch, and in what unit does JavaScript's Date.getTime() measure time from it?

    The Unix epoch is 00:00:00 UTC on 1 January 1970. JavaScript's getTime() returns milliseconds since the epoch (whereas classic Unix time counts seconds, so seconds = ms / 1000).

  15. Request Header Parser Microservice: what JSON does GET /api/whoami return, and where does each value come from?

    { ipaddress, language, software }: ipaddress from req.ip (or the x-forwarded-for header behind a proxy), language from the accept-language request header, and software from the user-agent request header.

  16. URL Shortener Microservice: describe the two endpoints and their responses.

    POST /api/shorturl with a URL in the body stores it and returns { original_url: <url>, short_url: <number> }. GET /api/shorturl/<short_url> looks up the stored original URL and redirects (res.redirect) to it.

  17. URL Shortener Microservice: how are invalid URLs handled, and what is a common validation technique?

    Invalid input must return { error: 'invalid url' }. Validation typically parses the URL (checking for a valid http:// or https:// format) and/or uses dns.lookup() on the hostname to verify it resolves.

  18. Exercise Tracker: what does POST /api/users do and what does it return?

    It creates a new user from a form field "username" and returns an object with the username and the database-generated _id: { username, _id }. GET /api/users returns an array of all such user objects.

  19. Exercise Tracker: what fields does POST /api/users/:_id/exercises accept, and what does the response look like?

    It accepts description (string), duration (number of minutes), and an optional date (defaults to the current date if omitted). It returns the user object with the exercise fields added: { _id, username, date, duration, description }, where date is formatted with toDateString().

  20. Exercise Tracker: what does GET /api/users/:_id/logs return, and what do the from, to, and limit query parameters do?

    It returns { username, count, _id, log } where log is an array of { description, duration, date } objects and count is the total number of exercises. from and to filter the log by date range (yyyy-mm-dd), and limit caps how many log entries are returned.

  21. In the Exercise Tracker log, what types must description, duration, and date have?

    description must be a String, duration must be a Number, and date must be a String in the format produced by Date.prototype.toDateString() (e.g., "Mon Jan 01 1990").

  22. File Metadata Microservice: what npm package handles the file upload, and how is it wired into the route?

    multer. It is used as route middleware, e.g. app.post('/api/fileanalyse', upload.single('upfile'), handler), where 'upfile' is the form field name; multer puts the file's info on req.file.

  23. File Metadata Microservice: what JSON does POST /api/fileanalyse return, and from which req.file properties?

    { name, type, size } taken from req.file.originalname (file name), req.file.mimetype (MIME type), and req.file.size (size in bytes).

  24. Why do HTML forms that upload files use enctype="multipart/form-data", and why can't express.urlencoded() parse them?

    multipart/form-data encodes the body in multiple parts so binary file contents can be transmitted alongside text fields; express.urlencoded()/express.json() only parse text-based bodies, so a multipart parser like multer is required to extract the file.

What this deck covers

The Back End Development and APIs deck follows the freeCodeCamp Back End Development and APIs syllabus — 5 chapters and 17 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 10.0 cards per chapter.

Answers are written to be recallable, not just readable — averaging about 206 characters, which is long enough to carry the reasoning and short enough to say out loud.

A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.

Back End Development and APIs flashcards FAQ

How many Back End Development and APIs flashcards are in this freeCodeCamp deck?

50 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.

Are these freeCodeCamp flashcards free?

Yes. The preview here is free to read with no signup, and the full 50-card deck is free inside the Examius app.

What do the Back End Development and APIs cards cover?

They follow the freeCodeCamp Back End Development and APIs syllabus — 5 chapters and 17 topics — so the questions track what is actually examinable.

How should I use these flashcards?

Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.