Unit 3 - Practice Quiz

INT332 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is a primary characteristic of a monolithic application architecture?

Monolithic vs microservices Easy
A. The application is built as a single, unified unit.
B. The database is always hosted on a separate cloud provider.
C. Every function has its own dedicated server.
D. The application is divided into hundreds of isolated containers.

2 Why do modern applications often use a microservices architecture?

Need for microservices Easy
A. To allow teams to develop, deploy, and scale application components independently.
B. To combine all code into one large file.
C. To ensure that if one feature fails, the entire application crashes.
D. To eliminate the need for computer networks.

3 How does microservices architecture improve scalability?

Advantages: scalability Easy
A. It limits the number of users that can access the application.
B. It requires buying larger physical servers.
C. You can scale only the specific services that experience high demand.
D. It replicates the entire application regardless of which part needs scaling.

4 What does fault isolation mean in the context of microservices?

Advantages: isolation Easy
A. A failure in one service does not necessarily bring down the entire application.
B. Developers work in isolated rooms.
C. Microservices cannot communicate with each other.
D. Databases are disconnected from the internet.

5 What is the primary role of an API Gateway in a microservices architecture?

API Gateway Easy
A. To act as a single entry point for client requests and route them to the appropriate microservices.
B. To store database backups.
C. To write code for the frontend.
D. To act as an operating system for containers.

6 What file format is primarily used by Docker Compose for its configuration files?

Docker Compose: YAML Structure Easy
A. XML
B. YAML
C. JSON
D. HTML

7 What is the default filename Docker Compose looks for when you run the docker-compose up command?

Writing docker-compose.yml Easy
A. compose.xml
B. Dockerfile
C. docker-compose.yml
D. docker.json

8 What does the version field at the top of a docker-compose.yml file specify?

version Easy
A. The version of the Docker Compose file format being used.
B. The version of the Linux kernel.
C. The version of your application code.
D. The number of containers to create.

9 In a docker-compose.yml file, what does the services section define?

services Easy
A. The customer support contact information.
B. The different containers (or application components) that make up the application.
C. The cloud provider hosting the app.
D. The physical hardware specifications.

10 What is the purpose of defining volumes in Docker Compose?

volumes Easy
A. To measure the amount of memory used.
B. To delete temporary files.
C. To increase the sound volume of the application.
D. To persist data generated by and used by Docker containers.

11 What is the function of the networks field in a docker-compose.yml file?

networks Easy
A. To schedule automatic updates.
B. To download the Docker engine.
C. To connect to social media platforms.
D. To define how containers communicate with each other.

12 How do you pass configuration settings, like database passwords, to a container in Docker Compose?

Environment variables Easy
A. Using the environment or env_file keywords in the YAML file.
B. By hardcoding them into the operating system.
C. By sending an email to the container.
D. By printing them to the terminal.

13 What is the difference between the build and image directives in Docker Compose?

Build vs image fields in YAML Easy
A. There is no difference; they are interchangeable.
B. build tells Compose to build an image from a Dockerfile, while image specifies a pre-built image to pull from a registry.
C. build downloads a pre-made image, while image deletes it.
D. build starts the container, while image stops it.

14 Which Docker Compose keyword is used to express dependency between services, ensuring one starts before another?

Service dependency ordering Easy
A. start_first
B. wait_for
C. needs
D. depends_on

15 In Docker Compose, what is the best practice for handling highly sensitive data like API keys or TLS certificates?

Secrets and configs Easy
A. Put them in the container's public logs.
B. Hardcode them in the Dockerfile.
C. Store them in plain text in the GitHub repository.
D. Use Docker secrets to mount sensitive data securely into the container.

16 In a standard three-tier multi-container application, what does the backend container usually do?

Multi-container apps (database + backend + frontend) Easy
A. It processes business logic and communicates with the database.
B. It manages the physical network cables.
C. It displays the user interface to the client.
D. It only stores long-term data files.

17 When deploying a WordPress application using Docker Compose, which database is traditionally paired with it as a separate service?

WordPress + MySQL Easy
A. MySQL
B. Redis
C. MongoDB
D. Cassandra

18 Why is MongoDB frequently paired with Node.js in multi-container deployments (the MEAN/MERN stack)?

Node.js + MongoDB Easy
A. MongoDB stores data in JSON-like documents, which works seamlessly with JavaScript in Node.js.
B. MongoDB is the only database supported by Docker.
C. MongoDB is a relational database requiring complex SQL.
D. Node.js natively speaks SQL.

19 When using Docker Compose to deploy a Java Spring Boot backend, what kind of service is PostgreSQL?

Java Spring Boot + PostgreSQL Easy
A. A relational database management system.
B. A message broker.
C. An API Gateway.
D. A frontend web framework.

20 How do microservices improve agility for development teams?

Advantages: agility Easy
A. Developers are forced to use only one programming language.
B. Agility is reduced because the code is too small.
C. Teams can develop, test, and deploy features quickly and independently.
D. Teams must wait for the entire company to finish coding before releasing.

21 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?

Monolithic vs microservices Medium
A. By sharing the payment processing database with the product catalog to balance the load.
B. By scaling the entire application cluster to handle the payment load.
C. By deploying the monolith inside a single larger Docker container with more CPU allocated.
D. By scaling only the payment processing service independently without replicating the rest of the application.

22 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?

API Gateway Medium
A. It acts as a single entry point, routing client requests to the appropriate underlying microservices.
B. It replaces the need for a frontend client by rendering HTML directly to the user.
C. It continuously monitors the health of Docker containers and restarts them if they fail.
D. It serves as the primary database for all microservices to ensure data consistency.

23 A developer introduces a memory leak in the 'Reporting' microservice. Under a microservices architecture, how does the 'isolation' advantage prevent a system-wide outage?

Advantages: scalability, isolation, agility Medium
A. The API Gateway will re-route the memory leak to a backup database.
B. The faulty microservice will crash, but other independent microservices will continue to function normally.
C. Docker Compose will dynamically allocate infinite memory to the reporting service to prevent a crash.
D. The memory leak is automatically fixed by the Docker daemon before it affects other services.

24 When defining a docker-compose.yml file, what does the version field primarily dictate?

version Medium
A. The version of the application code expected inside the container.
B. The version of the Docker images being pulled from Docker Hub.
C. The version of the operating system running on the host machine.
D. The specific compose file format and the supported features compatible with the installed Docker Engine.

25 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?

volumes Medium
A. Use the deploy: restart_policy to prevent the container from ever being destroyed.
B. Add a depends_on flag to ensure the database boots before the backend.
C. Map a named volume or host directory to the database's data directory using the volumes key.
D. Add a networks key to isolate the database from the backend.

26 Which of the following represents the correct hierarchical structure for defining a web service mapped to port 80 in docker-compose.yml?

Docker Compose: YAML Structure Medium
A. yaml\nservices:\n image: nginx\n web:\n ports:\n - "80:80"\n
B. yaml\nweb:\n services:\n image: nginx\n ports:\n - "80:80"\n
C. yaml\nservices:\n web:\n image: nginx\n ports:\n - "80:80"\n
D. yaml\nimage: nginx\nservices:\n web:\n ports:\n - "80:80"\n

27 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?

Environment variables Medium
A. The value from the .env file, as it takes global precedence.
B. The container will fail to start due to a variable conflict.
C. The values will be concatenated together.
D. The value defined in the docker-compose.yml file, as it overrides the .env file.

28 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?

networks Medium
A. Assign all three services to the default network but use firewall rules inside the frontend container.
B. Use the expose directive on the database so it is only visible to the host machine.
C. 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.
D. Set network_mode: isolated for the database service.

29 In a docker-compose.yml, what happens if a service defines BOTH the build and image fields?

Build vs image fields in YAML Medium
A. Docker Compose builds the image from the specified build context and tags it with the name provided in the image field.
B. Docker Compose builds the image but ignores the image tag, assigning a random hash as the name.
C. Docker Compose ignores the build field and exclusively pulls the image from Docker Hub.
D. Docker Compose throws a syntax error and refuses to run.

30 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?

Service dependency ordering Medium
A. Use depends_on with condition: service_started.
B. Use depends_on with condition: service_healthy and configure a healthcheck in the MongoDB service.
C. Use a sleep 30 command inside the docker-compose.yml for the backend.
D. Set restart: always on the MongoDB container to speed up its boot time.

31 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?

Secrets and configs Medium
A. Secrets bypass the Docker daemon and are injected directly by the host OS kernel.
B. Environment variables can only hold up to 256 characters, which is too short for most API tokens.
C. Docker Secrets automatically rotate the token every 30 days without application downtime.
D. Secrets are encrypted at rest and mounted into the container's in-memory filesystem (tmpfs), reducing exposure in logs or docker inspect.

32 When deploying a WordPress + MySQL stack using Docker Compose, how does the WordPress container know how to locate the MySQL database?

WordPress + MySQL Medium
A. By setting the environment variable WORDPRESS_DB_HOST to the service name of the MySQL container.
B. By querying the Docker daemon API for the IP address of the MySQL container.
C. By hardcoding the host machine's localhost IP into the WordPress configuration.
D. By mapping the same port 3306 on both containers so they share the network stack.

33 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?

Node.js + MongoDB Medium
A. mongodb://localhost:27017/myapp
B. mongodb://docker-host:27017/myapp
C. mongodb://127.0.0.1:27017/myapp
D. mongodb://mongo_db:27017/myapp

34 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?

Java Spring Boot + PostgreSQL Medium
A. The database service must be named postgres_server or have an alias of postgres_server on the shared network.
B. The PostgreSQL container must use the latest image tag.
C. The Spring Boot service must use network_mode: host.
D. The database must map port 5432 to the host machine using ports: - "5432:5432".

35 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?

Use Case Deployments: Multi-container apps (database + backend + frontend) Medium
A. By establishing a direct TCP connection to the PostgreSQL database container.
B. By making requests to localhost or the public domain/IP where the backend's port is exposed.
C. By using Docker's internal DNS resolver to route traffic through the API Gateway.
D. By making requests to the backend's internal Docker service name (e.g., http://backend:8080).

36 A developer writes the following snippet in docker-compose.yml:
yaml
ports:
- 8080:80

What does this mapping signify?

Writing docker-compose.yml Medium
A. Both port 8080 and 80 are exposed exclusively to other containers on the same Docker network.
B. Traffic to port 8080 on the host machine is routed to port 80 inside the container.
C. Traffic to port 80 on the host machine is routed to port 8080 inside the container.
D. The container listens on port 8080 and internally forwards it to port 80.

37 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'?

Microservices Architecture: Need for microservices Medium
A. By converting the relational database to a NoSQL database within the monolith.
B. By running multiple instances of the monolithic code over the same relational database.
C. By implementing a single API Gateway that queues database queries globally.
D. By utilizing polyglot persistence, where each microservice manages its own separate database.

38 If Service A depends on Service B in a docker-compose.yml file, what happens when you execute docker-compose stop Service B?

Service dependency ordering Medium
A. Docker Compose will automatically stop Service A as well to maintain dependency integrity.
B. Docker Compose will refuse to stop Service B and throw a dependency error.
C. Service A will restart automatically in an attempt to reconnect to Service B.
D. Service B will stop, but Service A will continue running until it manually crashes or is stopped.

39 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?

Environment variables Medium
A. Add the .env file to .gitignore so it is never committed to the version control repository.
B. Rename the .env file to .config so Docker Compose hides it automatically.
C. Upload the .env file to a public Docker Hub repository.
D. Commit the .env file to Git but encrypt it using Base64 encoding.

40 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?

Docker Compose: YAML Structure Medium
A. It does not need to be defined elsewhere; Docker Compose creates named volumes implicitly without top-level definitions.
B. It must be defined under a top-level volumes: block at the end of the docker-compose.yml file.
C. It must be defined within the .env file as VOLUME_NAME=mydata.
D. It must be defined inside the container's Dockerfile using the VOLUME instruction.

41 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?

Monolithic vs microservices Hard
A. Merging the databases back into a single shared database while keeping the application code separated into microservices.
B. Implementing a centralized Two-Phase Commit (2PC) protocol across all microservices to guarantee strict ACID properties.
C. Using the Saga pattern, relying on asynchronous messaging and compensating transactions to achieve eventual consistency.
D. Enforcing synchronous HTTP REST calls between all services within a single user request to ensure real-time consistency.

42 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?

API Gateway Hard
A. The API Gateway reads the docker-compose.yml file at runtime to map host ports to individual container IPs.
B. Docker Compose's embedded DNS server resolves the service name backend to a single IP that acts as a physical load balancer.
C. The API Gateway automatically leverages Docker Swarm's routing mesh, even when running in standard docker-compose mode.
D. 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.

43 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?

Docker Compose: YAML Structure Hard
A. Defining a global defaults: block at the top of the Compose file and inheriting it via the inherit: key.
B. Applying the template: key under each service to reference a standardized JSON configuration file.
C. Using YAML anchors (&) on extension fields (prefixed with x-) and merging them into services using aliases (<<: *).
D. Creating a separate docker-compose.common.yml file and importing it using the include directive inside the services block.

44 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?

Service dependency ordering Hard
A. Service A will start immediately after Service B's container enters the 'running' state, ignoring the healthcheck failure.
B. Service A will start, but Docker Compose will detach Service B from the custom network until it becomes healthy.
C. Docker Compose will automatically restart Service B until the healthcheck passes, and then start Service A.
D. Service A will wait indefinitely in the 'created' state, and Compose will eventually output a dependency error, preventing Service A from starting.

45 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?

Environment variables Hard
A. 5435
B. 5432
C. 5434
D. 5433

46 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?

Build vs image fields in YAML Hard
A. Compose builds the image using the context in ./webapp, tags the resulting image as custom-webapp:v2, and runs the container from it.
B. Compose builds a container from ./webapp with a random name, but aliases it to custom-webapp:v2 in the internal DNS.
C. Compose ignores the build instruction and attempts to pull custom-webapp:v2 from Docker Hub, failing if it's not found.
D. Compose throws a syntax error because build and image are mutually exclusive fields.

47 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?

volumes Hard
A. Docker automatically copies the existing contents from the container's directory into the empty named volume before mounting it.
B. The empty named volume overlays the directory, hiding the default files and causing PostgreSQL to crash due to missing configurations.
C. Docker throws an error stating that a named volume cannot be mounted to a non-empty directory without the nocopy flag.
D. The named volume is created as read-only to preserve the underlying files, requiring a manual volume initialization script.

48 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?

networks Hard
A. Create a single network app_net. Assign frontend, backend, and database to it, and use Docker's network_policy key to restrict traffic.
B. 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.
C. Attach all services to the default bridge network, but configure the expose key on the database service to only accept connections from the backend container's IP.
D. Place database in an internal: true network and frontend in an external: true network, while backend acts as a reverse proxy using links.

49 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?

Secrets and configs Hard
A. It is injected as a hidden environment variable, preventing it from showing up in docker inspect but still visible to child processes.
B. 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.
C. It is mounted as an encrypted volume in /var/lib/docker/secrets, requiring the application to decrypt it using a private key.
D. It is temporarily passed to the container's entrypoint via standard input (stdin) to prevent leaving files on the filesystem.

50 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?

Environment variables Hard
A. Docker Compose starts the container but gracefully disables the APP_TIMEOUT variable, removing it from the container's environment.
B. Docker Compose immediately exits with an error message "Error: TIMEOUT is not set" and refuses to start the application.
C. Docker Compose substitutes TIMEOUT with the string "?Error: TIMEOUT is not set" and starts the container.
D. Docker Compose uses a default timeout of 0 and logs a warning message containing "Error: TIMEOUT is not set".

51 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?

Java Spring Boot + PostgreSQL Hard
A. Docker Compose parses depends_on asynchronously, meaning Spring Boot can occasionally bypass the healthcheck lock if the host CPU is under heavy load.
B. The service_healthy condition guarantees the PostgreSQL container is running, but it does not guarantee that PostgreSQL is ready to accept TCP connections on port 5432.
C. Spring Boot's HikariCP connection pool attempts to resolve the postgres hostname before Docker's embedded DNS is fully initialized.
D. 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.

52 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?

Node.js + MongoDB Hard
A. Embed the rs.initiate() command inside the Node.js application's startup script to guarantee the database is configured before API requests are served.
B. Use the deploy.replicas key in Docker Compose to automatically inform MongoDB that it should bootstrap a replica set cluster.
C. Create an ephemeral mongo-setup service that depends_on the MongoDB nodes, runs a script with rs.initiate(), and immediately exits with restart: "no".
D. Modify the MongoDB service command to run mongod && mongo --eval "rs.initiate()" so initialization happens simultaneously with startup.

53 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?

WordPress + MySQL Hard
A. Port 3306 is not natively mapped to the host's loopback interface; WORDPRESS_DB_HOST must point to the Docker host gateway IP address.
B. MySQL rejects connections from port 8080; WORDPRESS_DB_HOST should be set to 127.0.0.1:3306.
C. 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).
D. WordPress is missing the MySQL client driver; the docker-compose.yml must include a build step to install mysqli before setting the host to localhost.

54 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?

version Hard
A. The version key is strictly enforced, and modern Compose will crash if it detects a version lower than '3.0'.
B. 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.
C. The version key determines whether Compose uses the Docker Swarm orchestrator or the local Docker Engine API.
D. The version key dictates the YAML schema syntax, requiring users to specify version: 'compose-spec' to use the latest features.

55 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?

Microservices Architecture: Need for microservices Hard
A. Polyglot Persistence
B. API Gateway Bottleneck
C. Event Sourcing
D. Distributed Monolith

56 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?

Service dependency ordering Hard
A. Compose starts Service C first, then Service B, and skips the dependency on Service A to break the loop automatically.
B. Compose detects the circular dependency, outputs an error, and immediately exits without starting any containers.
C. Compose enters an infinite loop, freezing the terminal while continuously attempting to resolve the dependency tree.
D. Compose starts Service A, B, and C in parallel, ignoring the depends_on graph because a cycle is present.

57 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?

Writing docker-compose.yml Hard
A. Using the scale: debug-tools=0 default parameter inside the Compose file.
B. Defining the debug-tools service under a profiles: array (e.g., profiles: ["debug"]).
C. Placing the debug-tools inside an override file and setting depends_on: [].
D. Using the restart: never policy on the debug-tools service.

58 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?

Advantages: scalability, isolation, agility Hard
A. 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.
B. The embedded Docker DNS will crash due to multiple identical hostnames; sticky sessions must be implemented at the OS layer.
C. The in-memory cache will automatically synchronize across containers via Docker's overlay network; no architectural change is needed.
D. Docker Compose restricts scaled containers to identical MAC addresses; the architecture must isolate each container into a distinct virtual network.

59 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?

Use Case Deployments: Multi-container apps (database + backend + frontend) Hard
A. http://frontend:3000/api/ because React automatically reverse-proxies all requests to connected internal networks.
B. http://backend:80/ because internal Docker communication bypasses port mappings and requires the default HTTP port.
C. 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.
D. http://backend:5000/ because Docker's internal DNS automatically resolves the service name for the browser.

60 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?

API Gateway Hard
A. It eliminates the need for the API Gateway to route traffic, reducing latency between services.
B. It offloads cross-cutting concerns, ensuring internal microservices can remain focused purely on business logic without duplicating security code.
C. It ensures that internal services automatically encrypt their inter-service HTTP communication via the Gateway's certificate.
D. It prevents internal microservices from communicating with one another, enforcing strict external-only traffic routing.