0
0
Microservicessystem_design~20 mins

Docker basics review in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Docker Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Docker Image Layers

Which statement best describes how Docker image layers work?

ALayers are stacked and share common files, so changes create new layers without duplicating unchanged data.
BEach layer is a complete copy of the entire image, making images large but independent.
CDocker images do not use layers; each image is a single file containing all data.
DLayers are only used during build time and discarded after the container starts.
Attempts:
2 left
💡 Hint

Think about how Docker saves space and speeds up builds by reusing parts.

Architecture
intermediate
2:00remaining
Docker Container Networking Basics

In a typical Docker setup, how do containers communicate with each other on the same host?

AContainers use the host's network stack directly without isolation.
BContainers cannot communicate with each other unless exposed to the internet.
CEach container has a unique public IP address assigned by Docker for direct communication.
DContainers communicate over a virtual bridge network created by Docker, allowing isolated but connected communication.
Attempts:
2 left
💡 Hint

Think about how Docker isolates containers but still allows them to talk inside the same machine.

scaling
advanced
2:00remaining
Scaling Microservices with Docker Containers

You have a microservice running in a Docker container that needs to handle increased traffic. Which approach best supports scaling this service?

ARun the container in privileged mode to allow it to use more host resources automatically.
BRun multiple instances of the container across different hosts and use a load balancer to distribute traffic.
CIncrease the CPU and memory limits of the single container to handle more requests.
DModify the container image to include all dependencies and restart it to refresh resources.
Attempts:
2 left
💡 Hint

Think about horizontal scaling and distributing load.

tradeoff
advanced
2:00remaining
Tradeoffs of Using Docker Volumes vs Bind Mounts

When persisting data for Docker containers, what is a key tradeoff between using Docker volumes and bind mounts?

ABind mounts automatically backup data; volumes require manual backup.
BBind mounts are encrypted by default; volumes are stored in plain text on the host.
CVolumes are managed by Docker and offer better portability; bind mounts directly map host files but can cause permission issues.
DVolumes cannot be shared between containers; bind mounts can be shared easily.
Attempts:
2 left
💡 Hint

Consider management, portability, and permission differences.

estimation
expert
2:00remaining
Estimating Docker Container Resource Needs

You plan to deploy 100 Docker containers running a CPU-intensive microservice on a server with 64 CPU cores and 256 GB RAM. Each container requires 0.5 CPU cores and 2 GB RAM. What is the minimum number of such servers needed to run all containers without resource contention?

A1 server
B4 servers
C3 servers
D2 servers
Attempts:
2 left
💡 Hint

Calculate total CPU and RAM needed, then divide by server capacity.