🌍 NodeJS · subject

NodeJS Advanced Topics Syllabus

The Advanced Topics syllabus for NodeJS in full: 3 chapters and 9 topics, every one listed below, plus 51 Advanced Topics flashcards with answers.

3Chapters
9Topics
51Flashcards

Advanced Topics syllabus: all 3 chapters

Expand any chapter to see its topics and sub-topics.

  1. Microservices

    3 topics
    • Introduction to Microservices
    • Building Microservices with NodeJS
    • Service Discovery
  2. GraphQL

    3 topics
    • Introduction to GraphQL
    • Setting Up GraphQL Server
    • Integrating with Express
  3. Serverless Architecture

    3 topics
    • Introduction to Serverless
    • AWS Lambda
    • Serverless Framework

NodeJS Advanced Topics flashcards — 51 questions with answers

  1. What is a microservices architecture?

    An architectural style that structures an application as a collection of small, independently deployable services, each running in its own process and communicating over lightweight mechanisms (typically HTTP/REST or messaging), organized around business capabilities.

  2. How does a monolithic architecture differ from a microservices architecture?

    A monolith is a single deployable unit where all functionality shares one codebase and process; microservices split functionality into many small, independently deployable and independently scalable services that communicate over the network.

  3. List three key benefits of microservices.

    Independent deployability (deploy one service without redeploying the whole app), independent/technology-agnostic scalability, fault isolation, and freedom to use different tech stacks per service.

  4. Name three common drawbacks or challenges of microservices.

    Operational complexity (many services to deploy/monitor), network latency and unreliability between services, distributed data management and eventual consistency, and harder end-to-end testing/debugging.

  5. In microservices, what is the difference between synchronous and asynchronous communication?

    Synchronous communication (e.g., HTTP/REST, gRPC) blocks the caller until a response returns; asynchronous communication (e.g., message queues/event brokers like RabbitMQ or Kafka) lets the sender continue without waiting, improving decoupling and resilience.

  6. What does 'each microservice owns its own database' (database-per-service) mean and why is it used?

    Each service has a private data store that only it can access directly; this enforces loose coupling and lets each service choose the best storage technology, at the cost of needing cross-service data coordination via APIs or events.

  7. What is an API Gateway in a microservices system?

    A single entry point that sits in front of the services and handles cross-cutting concerns like routing requests to the right service, authentication, rate limiting, load balancing, and response aggregation.

  8. Which NodeJS frameworks are commonly used to build individual microservices?

    Express, Fastify, NestJS, Koa, and Hapi are commonly used to build the HTTP/REST endpoints of NodeJS microservices.

  9. When building a NodeJS microservice, why are environment variables (e.g., via process.env or dotenv) important?

    They externalize configuration (ports, database URLs, secrets, service endpoints) so the same code runs in different environments, following the config principle of the Twelve-Factor App methodology.

  10. In NodeJS microservices, what is a health check endpoint and why is it needed?

    A lightweight endpoint (commonly GET /health or /healthz) that returns the service's status; orchestrators and load balancers poll it to determine whether the instance is alive and ready to receive traffic.

  11. What role does Docker typically play in deploying NodeJS microservices?

    Docker packages each service with its dependencies into a portable container image, giving consistent environments across dev/test/prod and enabling orchestration with tools like Kubernetes or Docker Compose.

  12. What is service discovery in a microservices architecture?

    The mechanism by which services automatically find the network locations (host and port) of other services, so instances can be located dynamically without hardcoding addresses.

  13. Contrast client-side and server-side service discovery.

    In client-side discovery, the client queries the service registry and picks an instance itself (does its own load balancing). In server-side discovery, the client calls a load balancer/router that queries the registry and forwards the request.

  14. What is a service registry?

    A database of available service instances and their network locations; services register on startup and deregister on shutdown, and clients or routers query it to discover instances. Examples: Consul, Eureka, etcd.

  15. Name two popular tools used for service discovery.

    Consul (HashiCorp), Netflix Eureka, etcd, Apache ZooKeeper, and Kubernetes' built-in DNS-based service discovery.

  16. How does Kubernetes provide service discovery?

    Kubernetes assigns each Service a stable virtual IP and a DNS name; pods reach other services by name (e.g., http://my-service) and kube-proxy load-balances requests across the healthy pods behind that Service.

  17. What is the difference between self-registration and third-party registration in service discovery?

    In self-registration, each service instance registers and deregisters itself with the registry. In third-party registration, a separate registrar component (or the platform) detects instances and registers them on their behalf.

  18. What is GraphQL?

    A query language for APIs and a runtime for fulfilling those queries, developed by Facebook, that lets clients request exactly the data they need from a single endpoint against a strongly typed schema.

  19. Name three ways GraphQL differs from REST.

    GraphQL uses a single endpoint (REST uses many URLs), lets the client specify exactly which fields to return (avoiding over-/under-fetching), and is defined by a strongly typed schema; REST typically returns fixed resource representations.

  20. What is over-fetching and under-fetching, and how does GraphQL address them?

    Over-fetching is receiving more data than needed; under-fetching is needing multiple requests to gather related data. GraphQL solves both by letting the client request precisely the fields it wants in one query.

Show the other 31 Advanced Topics flashcards
  1. What are the three root operation types in GraphQL?

    Query (read data), Mutation (write/modify data), and Subscription (receive real-time updates, typically over WebSockets).

  2. What is a GraphQL schema?

    A strongly typed contract, written in the Schema Definition Language (SDL), that defines the types, fields, and root operations (Query, Mutation, Subscription) the API exposes.

  3. What is a resolver in GraphQL?

    A function that returns the value for a particular field in the schema; GraphQL calls resolvers to fetch or compute the data for each requested field.

  4. What arguments does a GraphQL resolver function receive?

    Four arguments: parent (the result of the parent field), args (the field's arguments), context (shared per-request data like auth/DB connections), and info (query AST/execution metadata).

  5. In GraphQL SDL, what does the '!' symbol after a type mean?

    It marks the field as non-nullable (required); for example, name: String! means name must always return a non-null String.

  6. In GraphQL SDL, what does '[String!]!' mean?

    A non-nullable list of non-nullable Strings: the list itself cannot be null, and none of its elements can be null.

  7. List the five built-in scalar types in GraphQL.

    Int, Float, String, Boolean, and ID.

  8. What is the difference between a GraphQL 'type' and an 'input' type?

    An object type (type) describes data returned by the API; an input type (input) is used to pass structured arguments into queries and mutations and cannot have resolvers or circular object references the same way.

  9. What is Apollo Server?

    A popular, spec-compliant open-source GraphQL server library for NodeJS that lets you define a schema and resolvers and serve them over HTTP, with support for integrations, subscriptions, and tooling.

  10. What are the two required inputs to construct an Apollo Server (or most GraphQL servers) in NodeJS?

    typeDefs (the schema written in SDL) and resolvers (the map of functions that provide data for the schema's fields).

  11. How do you start a standalone Apollo Server (v4) in NodeJS?

    Create the server with new ApolloServer({ typeDefs, resolvers }), then call startStandaloneServer(server, { listen: { port } }), which returns the URL it is listening on.

  12. What is GraphQL introspection?

    A built-in feature that lets clients query the schema itself (via __schema and __type) to discover available types, fields, and operations; it powers tools like GraphiQL and Apollo Sandbox.

  13. How are the 'context' objects typically used in a GraphQL server?

    The context is created per request and holds shared data such as the authenticated user, database connections, and dataloaders, making it available to every resolver during that request.

  14. What is the N+1 problem in GraphQL and one way to solve it?

    When resolving a list, each item triggers a separate downstream query (1 for the list + N for items), causing many redundant calls. DataLoader batches and caches these requests within a single tick to reduce them.

  15. How do you integrate Apollo Server with an existing Express application?

    Use the expressMiddleware from @apollo/server/express4: create and await server.start(), then mount app.use('/graphql', cors(), express.json(), expressMiddleware(server, { context })) on your Express app.

  16. Why would you integrate GraphQL into Express rather than run it standalone?

    To reuse existing Express middleware (auth, logging, CORS, body parsing), serve REST and GraphQL from the same server, and add custom routes alongside the /graphql endpoint.

  17. Which HTTP method and status code does a typical GraphQL-over-HTTP request use?

    Queries and mutations are usually sent as HTTP POST to a single /graphql endpoint, and even errors commonly return HTTP 200 with an 'errors' array in the JSON response body.

  18. What is serverless computing?

    A cloud execution model where the provider dynamically manages server provisioning and scaling; developers deploy functions or code that run on demand, and billing is based on actual execution rather than pre-provisioned capacity.

  19. What does 'Function as a Service' (FaaS) mean?

    A serverless model where you deploy individual functions that the cloud provider runs in response to events, automatically scaling and charging only for execution time. AWS Lambda, Azure Functions, and Google Cloud Functions are examples.

  20. Give three benefits of serverless architectures.

    No server management, automatic scaling with demand, pay-per-use billing (no cost when idle), and faster time to market for individual functions.

  21. What is a 'cold start' in serverless?

    The added latency when a function is invoked after being idle, because the platform must initialize a new execution environment (container/runtime) before running the code; subsequent 'warm' invocations reuse it and are faster.

  22. Name two common limitations of serverless functions.

    Execution time limits (e.g., AWS Lambda caps at 15 minutes), cold-start latency, statelessness (no reliable local persistence between invocations), and vendor lock-in.

  23. What is AWS Lambda?

    Amazon's serverless FaaS compute service that runs your code in response to events and automatically manages the underlying compute; you upload a function and Lambda handles scaling, availability, and execution.

  24. What is the signature of a NodeJS AWS Lambda handler function?

    exports.handler = async (event, context) => { ... }; where event carries the invocation payload/trigger data and context provides runtime info (request ID, remaining time, memory).

  25. How is an AWS Lambda function typically triggered?

    By event sources such as API Gateway (HTTP requests), S3 events, DynamoDB Streams, SNS/SQS messages, EventBridge/CloudWatch scheduled events, and direct SDK invocations.

  26. What is the maximum execution timeout for an AWS Lambda function?

    15 minutes (900 seconds); memory is configurable (from 128 MB up to 10,240 MB), and CPU scales proportionally with allocated memory.

  27. How does AWS Lambda pricing work?

    You are charged per request plus for compute measured in GB-seconds, i.e., allocated memory multiplied by execution duration; there is no charge when the function is not running (a generous free tier also applies).

  28. What is the Serverless Framework?

    An open-source, provider-agnostic CLI and framework for developing, packaging, and deploying serverless applications (functions and their infrastructure) using a declarative configuration file, most commonly with AWS Lambda.

  29. What configuration file does the Serverless Framework use, and what does it define?

    serverless.yml (or .ts/.js/.json), which declaratively defines the provider, functions, their event triggers, resources, plugins, and environment configuration for the deployment.

  30. In serverless.yml, what does the 'functions' section define versus the 'events' within it?

    The 'functions' section lists each deployable function and its handler; the 'events' under a function define the triggers (e.g., http, schedule, s3, sqs) that invoke that function.

  31. Which Serverless Framework CLI command deploys your service to the cloud, and how do you remove it?

    'serverless deploy' (or 'sls deploy') packages and provisions the service (on AWS via CloudFormation); 'serverless remove' tears down all the deployed resources.

NodeJS Advanced Topics FAQ

What is in the NodeJS Advanced Topics syllabus?

NodeJS Advanced Topics is split into 3 chapters: Microservices, GraphQL and Serverless Architecture. Together they contain 9 topics.

How many chapters are in NodeJS Advanced Topics?

3 chapters, containing 9 topics. The largest chapter is Microservices, with 3 topics.

Are there flashcards for NodeJS Advanced Topics?

Yes — a 51-card Advanced Topics deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.