readyforhires

Docker & Kubernetes test (Intermediate)

30 questions · 35 minutes · Free

Images, containers, pods, deployments and services.

Take the Docker & Kubernetes test

What it covers

Interview format

Earn a certificate

The Docker & Kubernetes test is one of the 8 tests of the Backend Developer learning path. Pass it and the other 7 tests at 70% or more and readyforhires issues you a verifiable certificate in your name, with its own code and verify link to share or add to LinkedIn.

Sample learning path certificate for Backend Developer, made out to “Your name” and marked SAMPLE
Pass with 70% or more to earn a verifiable certificate. This is a sample: yours carries your name, the date you earned it and its own verify code.

Sample questions

5 sample questions from the Docker & Kubernetes test, with the answers. Samples are taken out of the live test, so you will not meet these when you sit it.

  1. Which Dockerfile concept refers to the sequential processing of instructions to ensure a deterministic and efficient build process?

    1. Layer inheritance
    2. Image tagging conventions
    3. Dockerfile instruction order
    4. Dockerfile multi-stage builds

    Answer: C. Dockerfile instruction order

    The order of instructions in a Dockerfile is crucial because Docker builds images layer by layer. Instructions like `RUN`, `COPY`, and `ADD` are processed sequentially, and changes made in later instructions do not affect earlier layers. This ensures that the build process is deterministic and efficient.

  2. Which of the following statements correctly describes how Dockerfile instructions are processed and how they affect image layers?

    1. Dockerfile instructions are processed in the order they are written, but only the first instruction creates a new layer.
    2. Dockerfile instructions are processed in reverse order, and only the final instruction creates a new layer.
    3. Dockerfile instructions are processed in the order they are written, but layers are merged into a single layer.
    4. Dockerfile instructions are processed in the order they are written, and each instruction creates a new layer in the image.

    Answer: D. Dockerfile instructions are processed in the order they are written, and each instruction creates a new layer in the image.

    Dockerfile instructions are executed sequentially, and each instruction adds a new layer to the image. This order is critical for building efficient images and ensuring that dependencies are properly layered.

  3. What is the recommended method for storing binary data in a ConfigMap in Kubernetes?

    1. Plain text
    2. Binary compression
    3. Hexadecimal encoding
    4. Base64 encoding

    Answer: D. Base64 encoding

    When storing binary data in ConfigMaps, it is recommended to use Base64 encoding to ensure compatibility and avoid issues with special characters. This is a standard practice in Kubernetes to handle binary data within ConfigMaps.

  4. Which of the following statements correctly describes the first instruction in a Dockerfile?

    1. A Dockerfile should start with a FROM instruction to specify the base image.
    2. A Dockerfile should start with a COPY instruction to copy files from the host into the image.
    3. A Dockerfile should start with a RUN instruction to execute commands during the build process.
    4. A Dockerfile should start with a CMD instruction to define the default command.

    Answer: A. A Dockerfile should start with a FROM instruction to specify the base image.

    The FROM instruction is the first and only required instruction in a Dockerfile, as it defines the base image upon which the Docker image is built. Other instructions like COPY, RUN, and CMD follow in a logical order to construct the image.

  5. Which scenario represents a common mistake when configuring Pod container limits that can lead to out-of-memory errors?

    1. The container's CPU limit is set to 500m, but the application is requesting 1CPU.
    2. The container's memory limit is set to 1GB, but the application is requesting 512MB.
    3. The container's memory limit is set to 512MB, but the application is requesting 1GB of memory.
    4. The container's CPU limit is set to 1CPU, but the application is requesting 500m.

    Answer: C. The container's memory limit is set to 512MB, but the application is requesting 1GB of memory.

    When a container's memory limit is set lower than the application's memory request, it can cause out-of-memory (OOM) errors. Kubernetes will not allow the container to use more memory than the limit, which can lead to termination if the application exceeds the limit. The correct answer highlights this scenario, which is a common mistake when configuring resource limits.

Frequently asked questions

How many questions are in the Docker & Kubernetes test?
30 questions (18 multiple choice, 12 multi-answer), with 35 minutes to answer them.
What does the Docker & Kubernetes test cover?
Images and layers, Dockerfile best practice, Pods and deployments, Services and ingress, Config and secrets.
Is the Docker & Kubernetes test free?
Yes. It is free to take with a readyforhires account.
What level is the Docker & Kubernetes test?
Intermediate, in DevOps & cloud.

More DevOps & cloud tests

Roles that test these skills

Companies that test these skills

All practice tests · All DevOps & cloud tests

Last updated