Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
What file format is primarily used by Docker Compose for its configuration files?
Not quite. Try another option.
Answer: YAML
Docker Compose uses YAML (Yet Another Markup Language) for defining and running multi-container Docker applications.
Question 7 of 60 · Writing docker-compose.yml · Easy
What is the default filename Docker Compose looks for when you run the docker-compose up command?
Not quite. Try another option.
Answer: docker-compose.yml
By default, Docker Compose looks for a file named docker-compose.yml or docker-compose.yaml in the current directory.
Question 8 of 60 · version · Easy
What does the version field at the top of a docker-compose.yml file specify?
Not quite. Try another option.
Answer: The version of the Docker Compose file format being used.
The version key tells Docker Compose which version of the Compose specification the YAML file is written in.
Question 9 of 60 · services · Easy
In a docker-compose.yml file, what does the services section define?
Not quite. Try another option.
Answer: The different containers (or application components) that make up the application.
The services block defines the individual containers that will be run, such as a web server, a database, or a background worker.
Question 10 of 60 · volumes · Easy
What is the purpose of defining volumes in Docker Compose?
Not quite. Try another option.
Answer: To persist data generated by and used by Docker containers.
Volumes are used to store data persistently so that it is not lost when a container is stopped or removed.
Question 11 of 60 · networks · Easy
What is the function of the networks field in a docker-compose.yml file?
Not quite. Try another option.
Answer: To define how containers communicate with each other.
The networks section configures custom networks to allow communication between specific services while keeping them isolated from others.
Question 12 of 60 · Environment variables · Easy
How do you pass configuration settings, like database passwords, to a container in Docker Compose?
Not quite. Try another option.
Answer: Using the environment or env_file keywords in the YAML file.
Environment variables allow you to pass dynamic configuration settings into containers, often defined using the environment key in the YAML file.
Question 13 of 60 · Build vs image fields in YAML · Easy
What is the difference between the build and image directives in Docker Compose?
Not quite. Try another option.
Answer: build tells Compose to build an image from a Dockerfile, while image specifies a pre-built image to pull from a registry.
build is used when you need to compile an image from source (using a Dockerfile), whereas image simply pulls an existing image from Docker Hub or another registry.
Question 14 of 60 · Service dependency ordering · Easy
Which Docker Compose keyword is used to express dependency between services, ensuring one starts before another?
Not quite. Try another option.
Answer: depends_on
The depends_on keyword dictates the order of service startup, ensuring dependencies (like databases) start before the services that rely on them.
Question 15 of 60 · Secrets and configs · Easy
In Docker Compose, what is the best practice for handling highly sensitive data like API keys or TLS certificates?
Not quite. Try another option.
Answer: Use Docker secrets to mount sensitive data securely into the container.
Docker secrets provide a secure mechanism for managing and distributing sensitive data to containers without exposing them in configuration files or code.
In a standard three-tier multi-container application, what does the backend container usually do?
Not quite. Try another option.
Answer: It processes business logic and communicates with the database.
In a 3-tier setup, the frontend handles UI, the backend processes business logic and API requests, and the database stores the data.
Question 17 of 60 · WordPress + MySQL · Easy
When deploying a WordPress application using Docker Compose, which database is traditionally paired with it as a separate service?
Not quite. Try another option.
Answer: MySQL
WordPress is traditionally built on a LAMP/LEMP stack and requires a relational database like MySQL or MariaDB to store its content.
Question 18 of 60 · Node.js + MongoDB · Easy
Why is MongoDB frequently paired with Node.js in multi-container deployments (the MEAN/MERN stack)?
Not quite. Try another option.
Answer: MongoDB stores data in JSON-like documents, which works seamlessly with JavaScript in Node.js.
MongoDB is a NoSQL database that uses BSON (binary JSON). This makes it highly compatible with Node.js, which uses JavaScript objects.
Question 19 of 60 · Java Spring Boot + PostgreSQL · Easy
When using Docker Compose to deploy a Java Spring Boot backend, what kind of service is PostgreSQL?
Not quite. Try another option.
Answer: A relational database management system.
PostgreSQL is a powerful, open-source object-relational database system commonly paired with robust backend frameworks like Java Spring Boot.
Question 20 of 60 · Advantages: agility · Easy
How do microservices improve agility for development teams?
Not quite. Try another option.
Answer: Teams can develop, test, and deploy features quickly and independently.
Microservices enable smaller teams to work on independent parts of the application, leading to faster development cycles and quicker feature releases.
Question 21 of 60 · Monolithic vs microservices · Medium
An e-commerce application is experiencing high traffic exclusively on its payment processing module during a sale. How does a microservices architecture handle this more efficiently than a monolithic architecture?
Not quite. Try another option.
Answer: By scaling only the payment processing service independently without replicating the rest of the application.
Microservices allow individual components to be scaled independently based on demand. Instead of scaling the entire monolithic application (which consumes unnecessary resources), only the heavily loaded payment service is scaled.
Question 22 of 60 · API Gateway · Medium
In a microservices architecture involving a UI frontend and multiple backend services (e.g., users, orders, inventory), what is the primary role of an API Gateway?
Not quite. Try another option.
Answer: It acts as a single entry point, routing client requests to the appropriate underlying microservices.
An API Gateway provides a unified interface for clients, handling routing, composition, and protocol translation, which simplifies the client implementation by hiding the microservice boundaries.
Question 23 of 60 · Advantages: scalability, isolation, agility · Medium
A developer introduces a memory leak in the 'Reporting' microservice. Under a microservices architecture, how does the 'isolation' advantage prevent a system-wide outage?
Not quite. Try another option.
Answer: The faulty microservice will crash, but other independent microservices will continue to function normally.
Isolation ensures that a failure (like a crash due to a memory leak) in one microservice does not cascade and bring down the entire system, allowing other services to remain operational.
Question 24 of 60 · version · Medium
When defining a docker-compose.yml file, what does the version field primarily dictate?
Not quite. Try another option.
Answer: The specific compose file format and the supported features compatible with the installed Docker Engine.
The version field at the top of a docker-compose.yml file specifies the schema version. Different versions support different configuration options and require specific minimum versions of the Docker Engine.
Question 25 of 60 · volumes · Medium
A PostgreSQL database container is destroyed and recreated using Docker Compose, resulting in complete data loss. Which configuration should be added to the docker-compose.yml to prevent this in the future?
Not quite. Try another option.
Answer: Map a named volume or host directory to the database's data directory using the volumes key.
Containers are ephemeral by nature. To persist data across container restarts and recreations, you must mount a volume (named or bind mount) to the path where the database stores its data.
Question 26 of 60 · Docker Compose: YAML Structure · Medium
Which of the following represents the correct hierarchical structure for defining a web service mapped to port 80 in docker-compose.yml?
In a Docker Compose YAML file, the top-level key is services, followed by the service name (web in this case), which then contains configuration details like image and ports.
Question 27 of 60 · Environment variables · Medium
If an environment variable DB_PASS is defined in an .env file, and simultaneously defined under the environment section of a service in docker-compose.yml with a different value, what will be the value inside the container?
Not quite. Try another option.
Answer: The value defined in the docker-compose.yml file, as it overrides the .env file.
Variables defined directly in the docker-compose.yml (under the environment key) take precedence over variables loaded implicitly from a .env file.
Question 28 of 60 · networks · Medium
You have a frontend service and a backend service in docker-compose.yml. You want the backend to communicate with the database, but the frontend should NOT be able to reach the database. How can this be achieved?
Not quite. Try another option.
Answer: Create two separate custom networks (e.g., frontend_net, backend_net), connect the backend to both, the frontend to frontend_net, and the database to backend_net.
Custom networks provide network isolation. By putting the frontend and backend on one network, and backend and DB on another, the frontend has no network path to communicate with the DB.
Question 29 of 60 · Build vs image fields in YAML · Medium
In a docker-compose.yml, what happens if a service defines BOTH the build and image fields?
Not quite. Try another option.
Answer: Docker Compose builds the image from the specified build context and tags it with the name provided in the image field.
When both are specified, Compose builds the image from the Dockerfile found at the build path and then names (tags) the resulting local image with the string specified in the image field.
Question 30 of 60 · Service dependency ordering · Medium
A Node.js backend crashes upon startup because the MongoDB container it depends on is still initializing, even though depends_on: - mongo is used. What is the correct way to ensure the backend waits until MongoDB is fully ready to accept connections?
Not quite. Try another option.
Answer: Use depends_on with condition: service_healthy and configure a healthcheck in the MongoDB service.
By default, depends_on only waits for the dependent container to start, not to be "ready". Using condition: service_healthy ensures Compose waits for the database's healthcheck to pass before starting the backend.
Question 31 of 60 · Secrets and configs · Medium
When passing highly sensitive data like an API token to a service in Docker Compose, why is using Docker Secrets generally preferred over standard environment variables?
Not quite. Try another option.
Answer: Secrets are encrypted at rest and mounted into the container's in-memory filesystem (tmpfs), reducing exposure in logs or docker inspect.
Docker Secrets are securely delivered to the container and mounted at /run/secrets/. Unlike environment variables, they are not exposed in the output of docker inspect or accidentally leaked into application logs.
Question 32 of 60 · WordPress + MySQL · Medium
When deploying a WordPress + MySQL stack using Docker Compose, how does the WordPress container know how to locate the MySQL database?
Not quite. Try another option.
Answer: By setting the environment variable WORDPRESS_DB_HOST to the service name of the MySQL container.
Docker Compose’s internal DNS allows containers on the same network to resolve each other by their service name. WordPress uses WORDPRESS_DB_HOST (e.g., set to db) to connect.
Question 33 of 60 · Node.js + MongoDB · Medium
A developer sets up a Node.js backend and a MongoDB database. The database service is named mongo_db. What should the Mongoose connection string look like in the Node.js application?
Not quite. Try another option.
Answer: mongodb://mongo_db:27017/myapp
Because Docker Compose networks allow DNS resolution based on service names, the Node.js app must use mongo_db as the hostname in the connection URI to connect to the MongoDB container.
Question 34 of 60 · Java Spring Boot + PostgreSQL · Medium
In a Docker Compose deployment of a Spring Boot app and a PostgreSQL database, the Spring Boot application configuration (application.properties) has spring.datasource.url=jdbc:postgresql://postgres_server:5432/mydb. Which of the following MUST be true in docker-compose.yml for the connection to work?
Not quite. Try another option.
Answer: The database service must be named postgres_server or have an alias of postgres_server on the shared network.
Internal container-to-container communication relies on Docker's embedded DNS. The hostname postgres_server used in the JDBC URL must match the service name or a network alias defined in docker-compose.yml.
Question 35 of 60 · Use Case Deployments: Multi-container apps (database + backend + frontend) · Medium
You are deploying a 3-tier application (React frontend, Express backend, PostgreSQL database) using Docker Compose. The React frontend runs in a user's browser. How should the frontend make API calls to the backend?
Not quite. Try another option.
Answer: By making requests to localhost or the public domain/IP where the backend's port is exposed.
Because the React frontend executes client-side (in the user's browser, outside the Docker network), it cannot use Docker's internal DNS (http://backend). It must use the host's IP or a public domain to reach the backend's exposed port.
Question 36 of 60 · Writing docker-compose.yml · Medium
A developer writes the following snippet in docker-compose.yml:
yaml
ports:
- 8080:80
What does this mapping signify?
Not quite. Try another option.
Answer: Traffic to port 8080 on the host machine is routed to port 80 inside the container.
In Docker Compose, port mappings are defined as HOST_PORT:CONTAINER_PORT. Thus, 8080:80 means port 8080 on the host maps to port 80 inside the container.
Question 37 of 60 · Microservices Architecture: Need for microservices · Medium
A legacy monolithic application uses a single relational database for all transactions. As the user base grows, database locks cause widespread performance issues. How does a microservices architecture address this specific 'Need for microservices'?
Not quite. Try another option.
Answer: By utilizing polyglot persistence, where each microservice manages its own separate database.
A core tenet of microservices is decentralized data management. Each service manages its own database, preventing system-wide bottlenecks caused by a single shared database.
Question 38 of 60 · Service dependency ordering · Medium
If Service A depends on Service B in a docker-compose.yml file, what happens when you execute docker-compose stop Service B?
Not quite. Try another option.
Answer: Service B will stop, but Service A will continue running until it manually crashes or is stopped.
The depends_on directive only dictates the order of startup (and shutdown when stopping the entire stack). It does not enforce runtime lifecycle constraints, so stopping Service B manually leaves Service A running.
Question 39 of 60 · Environment variables · Medium
A developer wants to keep database credentials out of the docker-compose.yml file tracked in Git. They place the credentials in an .env file. What is a crucial best practice regarding this .env file?
Not quite. Try another option.
Answer: Add the .env file to .gitignore so it is never committed to the version control repository.
Sensitive data such as credentials should never be committed to source control. Adding .env to .gitignore ensures that developers keep secrets local and secure.
Question 40 of 60 · Docker Compose: YAML Structure · Medium
Consider the volumes configuration in a Docker Compose service:
yaml
volumes:
- mydata:/var/lib/mysql
Where must mydata be defined for this configuration to be completely valid at the file level?
Not quite. Try another option.
Answer: It must be defined under a top-level volumes: block at the end of the docker-compose.yml file.
When using named volumes in Docker Compose, you must declare the volume name in a top-level volumes: block, independent of the services: block, to instruct Docker to provision the volume.
Question 41 of 60 · Monolithic vs microservices · Hard
A team is migrating a legacy monolithic application to a microservices architecture. They notice that transactions previously handled by a single ACID-compliant database commit now span multiple distinct services and databases. Which of the following architectural patterns is most appropriate to manage data consistency across these services?
Not quite. Try another option.
Answer: Using the Saga pattern, relying on asynchronous messaging and compensating transactions to achieve eventual consistency.
In microservices, strict ACID transactions across distributed databases (like 2PC) create tight coupling and severe performance bottlenecks. The Saga pattern manages distributed transactions using a sequence of local transactions and compensating actions to handle failures, achieving eventual consistency.
Question 42 of 60 · API Gateway · Hard
In a Docker Compose deployment containing an API Gateway and multiple scaled instances of a backend service (e.g., docker-compose up --scale backend=3), how does the API Gateway natively resolve the internal routing to distribute traffic among the backend instances?
Not quite. Try another option.
Answer: Docker's embedded DNS server returns multiple IP addresses for the service name backend, and the API Gateway must rely on DNS Round Robin or client-side load balancing.
In standard Docker Compose (non-Swarm), scaling a service results in multiple containers with distinct IP addresses. The embedded Docker DNS server resolves the service name to a list of IPs. The API Gateway (e.g., Nginx or Traefik) utilizes DNS round-robin to distribute the traffic across these IPs.
Question 43 of 60 · Docker Compose: YAML Structure · Hard
When designing a complex docker-compose.yml file, you need multiple services to share identical logging configurations, environment variables, and restart policies without duplicating code. Which YAML feature is natively utilized in Compose to achieve this DRY (Don't Repeat Yourself) principle?
Not quite. Try another option.
Answer: Using YAML anchors (&) on extension fields (prefixed with x-) and merging them into services using aliases (<<: *).
Docker Compose supports extension fields that begin with x-. Combined with standard YAML anchors (&) and alias/merge keys (* and <<:), developers can define reusable blocks of configuration and inject them into multiple services to maintain clean, non-repetitive code.
Question 44 of 60 · Service dependency ordering · Hard
Service A has a depends_on configuration pointing to Service B with the condition service_healthy. Service B defines a healthcheck in the Compose file. If Service B starts successfully but its healthcheck repeatedly fails (returns unhealthy), what will Docker Compose do when starting the environment?
Not quite. Try another option.
Answer: Service A will wait indefinitely in the 'created' state, and Compose will eventually output a dependency error, preventing Service A from starting.
When depends_on specifies condition: service_healthy, Compose will block the startup of the dependent service (Service A) until the dependency (Service B) explicitly reports a 'healthy' status. If it never becomes healthy, Compose will timeout or fail the deployment, and Service A will not start.
Question 45 of 60 · Environment variables · Hard
Consider the following environment variable hierarchy in Docker Compose. You have an environment variable DB_PORT set to 5432 in the .env file, DB_PORT=5433 exported in your host OS shell, DB_PORT=5434 defined in an env_file referenced in the Compose file, and DB_PORT: 5435 defined directly under the environment: key of the service. What value will the container actually use for DB_PORT?
Not quite. Try another option.
Answer: 5435
In Docker Compose, environment variables defined directly in the docker-compose.yml file under the environment: key have the highest precedence and will override variables from env_file, .env files, and host OS shell variables.
Question 46 of 60 · Build vs image fields in YAML · Hard
In a docker-compose.yml file, a service defines both the build: ./webapp and image: custom-webapp:v2 keys simultaneously. What is the precise behavior when docker-compose up -d is executed, assuming the image custom-webapp:v2 does not exist locally?
Not quite. Try another option.
Answer: Compose builds the image using the context in ./webapp, tags the resulting image as custom-webapp:v2, and runs the container from it.
When both build and image are specified, Compose uses the build context to build the image, and then tags the newly built image with the name and tag specified in the image field. This is highly useful for building custom images that you later intend to push to a registry.
Question 47 of 60 · volumes · Hard
A docker-compose.yml file provisions a PostgreSQL database using a named volume db_data mounted at /var/lib/postgresql/data. Upon the very first startup, the named volume is completely empty, but the PostgreSQL base image already contains default database configuration files at /var/lib/postgresql/data. What happens to these files?
Not quite. Try another option.
Answer: Docker automatically copies the existing contents from the container's directory into the empty named volume before mounting it.
In Docker, if a named volume is empty and you mount it into a directory in the container that already contains files or directories, Docker will populate the volume with the contents of that container directory by default. This does not happen with host bind mounts.
Question 48 of 60 · networks · Hard
You are deploying a multi-tier application using Docker Compose with three services: frontend, backend, and database. You want frontend to only communicate with backend, and backend to communicate with both frontend and database. The database should be completely unreachable from the frontend. Which network configuration enforces this isolation?
Not quite. Try another option.
Answer: Create two networks: front_net and back_net. Attach frontend to front_net, database to back_net, and backend to both front_net and back_net.
Docker Compose enables network isolation by defining custom networks. By placing the frontend and backend on one network, and the backend and database on a separate network, the frontend physically cannot route packets to the database, enforcing strict architectural isolation.
Question 49 of 60 · Secrets and configs · Hard
In a non-Swarm local Docker Compose deployment, a service is configured to use a secret defined via a file (e.g., file: ./db_password.txt). How is this secret materialized inside the running container, and what are the security implications compared to environment variables?
Not quite. Try another option.
Answer: It is mounted as an in-memory, read-only file (typically under /run/secrets/), which avoids exposing sensitive data in environment variables or docker inspect outputs.
When using the secrets key in local Docker Compose, Compose simulates Swarm secret behavior by creating a read-only bind mount of the secret file, usually mapping it to /run/secrets/<secret_name>. This is much more secure than environment variables, which can be easily leaked via crash logs, child processes, or docker inspect.
Question 50 of 60 · Environment variables · Hard
A docker-compose.yml file contains the following environment variable declaration for a service: APP_TIMEOUT: ${TIMEOUT:?Error: TIMEOUT is not set}. If the user runs docker-compose up without defining the TIMEOUT variable in their shell or .env file, what is the exact outcome?
Not quite. Try another option.
Answer: Docker Compose immediately exits with an error message "Error: TIMEOUT is not set" and refuses to start the application.
The syntax ${VAR:?error_message} in Docker Compose dictates that if the variable VAR is unset or empty, Compose should fail immediately and output the custom error message. It enforces that required environment variables must be provided before deployment.
Question 51 of 60 · Java Spring Boot + PostgreSQL · Hard
A microservices deployment features a Java Spring Boot application and a PostgreSQL database in Docker Compose. The spring-boot service depends_on the postgres service with condition: service_healthy. However, the Spring Boot application intermittently crashes on startup, throwing a Connection refused exception. Which of the following is the most likely architectural root cause?
Not quite. Try another option.
Answer: The PostgreSQL healthcheck script succeeds as soon as the container's OS boots, but the database initialization scripts inside docker-entrypoint-initdb.d take longer, causing a race condition.
If the healthcheck simply checks if the process is running (e.g., pg_isready), it might succeed before heavy, initial .sql files in docker-entrypoint-initdb.d finish executing. The database briefly restarts or remains locked during this phase, causing Spring Boot to fail connecting despite the service_healthy flag passing initially.
Question 52 of 60 · Node.js + MongoDB · Hard
You are setting up a Node.js application backed by a MongoDB Replica Set using Docker Compose. A Replica Set requires an initialization command (rs.initiate()) to be run exactly once after the MongoDB nodes start. What is the most robust and Docker-native way to handle this initialization in a docker-compose.yml file?
Not quite. Try another option.
Answer: Create an ephemeral mongo-setup service that depends_on the MongoDB nodes, runs a script with rs.initiate(), and immediately exits with restart: "no".
MongoDB replica sets require the primary daemon to be fully running before it can accept the rs.initiate() command. Using a short-lived, ephemeral container that waits for MongoDB to be healthy, executes the setup script, and then terminates is the cleanest, most decoupled way to handle one-time initializations in Compose.
Question 53 of 60 · WordPress + MySQL · Hard
A user deploys WordPress and MySQL using Docker Compose. They map the WordPress container's port to 8080:80 and the MySQL container's port to 3306:3306. In the WordPress configuration (WORDPRESS_DB_HOST), they specify localhost:3306. When they navigate to http://localhost:8080, WordPress fails to connect to the database. Why does this happen, and how should it be fixed?
Not quite. Try another option.
Answer: The Docker network bridge prevents localhost routing between containers; WORDPRESS_DB_HOST should be changed to the service name of the MySQL container (e.g., db:3306).
Inside a container, localhost (or 127.0.0.1) refers to the container's own loopback interface, not the host machine or other containers. To connect to MySQL, WordPress must use the Docker DNS name of the MySQL service (e.g., db or mysql) provided by Docker's internal networking.
Question 54 of 60 · version · Hard
In the modern Compose Specification (integrated into Docker Compose V2), the top-level version: element (e.g., version: '3.8') behaves differently than in classic docker-compose V1. Which of the following statements accurately describes the handling of the version key in modern Compose?
Not quite. Try another option.
Answer: The version key is deprecated and purely informational; modern Compose dynamically merges v2.x and v3.x features (like depends_on: condition and deploy: resources) regardless of the declared version.
With the unification of the Compose Specification and the release of Docker Compose V2, the version property is retained only for backward compatibility. The tool now supports all features simultaneously (combining the best of v2.x and v3.x, like healthchecks and deploy configurations) without strictly enforcing a specific schema version.
Question 55 of 60 · Microservices Architecture: Need for microservices · Hard
An organization adopted microservices to increase release agility. However, they now find that every time they update the 'Order' service, they must also deploy specific versions of the 'Inventory' and 'Billing' services simultaneously to prevent system crashes. What architectural anti-pattern has the organization likely created?
Not quite. Try another option.
Answer: Distributed Monolith
When microservices are highly interdependent and must be deployed together in lockstep, it defeats the agility and independent scalability benefits of microservices. This tight coupling creates a 'Distributed Monolith', which carries the complexity of distributed systems without their primary benefits.
Question 56 of 60 · Service dependency ordering · Hard
In a complex docker-compose.yml, Service A depends on Service B, Service B depends on Service C, and Service C depends on Service A. All dependencies are standard (no healthcheck conditions). What is the outcome when docker-compose up is executed?
Not quite. Try another option.
Answer: Compose detects the circular dependency, outputs an error, and immediately exits without starting any containers.
Docker Compose parses the dependency graph before deploying any services. If it detects a circular dependency (A -> B -> C -> A), it will throw an error regarding the circular reference and fail to start, as it cannot determine a valid topological sort order for startup.
Question 57 of 60 · Writing docker-compose.yml · Hard
You have a docker-compose.yml containing a primary web application and an optional debug-tools service. You want debug-tools to be completely ignored by default when running docker-compose up, but you want the ability to explicitly start it when troubleshooting. Which Docker Compose feature is explicitly designed to handle this scenario?
Not quite. Try another option.
Answer: Defining the debug-tools service under a profiles: array (e.g., profiles: ["debug"]).
Compose profiles allow developers to group services and only start them when explicitly requested. By assigning profiles: ["debug"] to a service, it won't start during a standard docker-compose up unless the user runs docker-compose --profile debug up.
Question 58 of 60 · Advantages: scalability, isolation, agility · Hard
A team wishes to leverage Docker Compose to horizontally scale a backend Node.js microservice (docker-compose up --scale backend=5). The backend uses an in-memory cache to store user session tokens. Which of the following issues will occur, and what is the required architectural change to support this scaling?
Not quite. Try another option.
Answer: User requests will be routed round-robin to different containers, causing session state to be lost across requests; the architecture must migrate to a centralized caching layer like Redis.
Horizontal scaling requires services to be stateless. If a service stores sessions in-memory, a request might be routed to Container A (where the session exists), but the next request goes to Container B (where it doesn't). The application architecture must externalize state into a shared data store like Redis to support scalability.
Question 59 of 60 · Use Case Deployments: Multi-container apps (database + backend + frontend) · Hard
In a multi-container deployment, the frontend container (React/Nginx) needs to make API calls to the backend container (Express/Node.js). The frontend container is mapped to host port 3000, and the backend is mapped to host port 5000. In the React application code running in the user's browser, which base URL should be used to fetch data from the backend?
Not quite. Try another option.
Answer: http://localhost:5000/ (or the host's public IP) because the React code executes client-side in the user's browser, outside the Docker network.
A common point of confusion in multi-container setups is frontend-to-backend communication. React code runs in the client's web browser, not inside the Docker container. Therefore, the browser cannot resolve internal Docker hostnames like backend. It must connect to the backend via the exposed host port (localhost:5000 during local development).
Question 60 of 60 · API Gateway · Hard
When introducing an API Gateway (like Traefik or Nginx) to a Docker Compose microservices architecture, you decide to implement SSL/TLS termination and JWT token validation directly at the Gateway. What is the primary architectural advantage of this approach?
Not quite. Try another option.
Answer: It offloads cross-cutting concerns, ensuring internal microservices can remain focused purely on business logic without duplicating security code.
An API Gateway centralizes cross-cutting concerns (like SSL termination, authentication, and rate limiting). This simplifies the development of individual microservices, as they no longer need to implement and maintain duplicate logic for handling certificates or JWT verification, allowing developers to focus solely on the core business logic.
That's unit 3
Answer a few questions and your score shows up here.
Nearly through. Did unit 3 of INT332 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 3 of INT332 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.