Search test library by skills or roles
⌘ K

Adaface Sample Docker Questions

Here are some sample Docker questions from our premium questions library (10273 non-googleable questions).

Skills

🧐 Question

Medium

Dockerfile Updates
Cache
Solve
Check the following Dockerfile used for a project (STAGE 1):
 image
We created an image from this Dockerfile on Dec 14 2021. A couple of weeks after Dec 14 2021, Ubuntu released new security updates to their repository. After 2 months, we modified the file (STAGE 2):
 image
Couple of weeks later, we further modified the file to add a local file ada.txt to /ada.txt (STAGE 3): (Note that ada.txt exists in /home/adaface and the dockerfile exists in /home/code folders)
 image
Pick correct statements:
            
            A: If we run “docker build .” at STAGE 2, new Ubuntu updates will be fetched because apt-get update will be run again since cache is invalidated for all lines/layers of Dockerfile when a new line is added.
            B: If we run “docker build .” at STAGE 2, new Ubuntu updates will not be fetched since cache is invalidated only for last two lines of the updated Dockerfile. Since the first two commands remain the same, cached layers are re-used skipping apt get update.
            C: To skip Cache, “docker build -no-cache .” can be used at STAGE 2. This will ensure new Ubuntu updates are picked up.
            D: Docker command “docker build .” at STAGE 3 works as expected and adds local file ada.txt to the image.
            E: Docker command “docker build .” at STAGE 3 gives an error “no such file or directory” since /home/adaface/ada.txt is not part of the Dockerfile context.

Medium

Efficient Dockerfile
Dockerfile
Solve
Review the following Dockerfiles that work on two projects (project and project2):
 image
All Docker files have the same end result:
            
            - ‘project’ is cloned from git. After running few commands, ‘project’ code is removed.
            - ‘project2’ is copied from file system and permissions to the folder is changed.
Pick the correct statements:
            
            A: File 1 is the most efficient of all.
            B: File 2 is the most efficient of all.
            C: File 3 is the most efficient of all.
            D: File 4 is the most efficient of all.
            E: Merging multiple RUN commands into a single RUN command is efficient for ‘project’ since each RUN command creates a new layer with changed files and folders. Deleting files with RUN only marks these files as deleted but does not reclaim disk space. 
            F: Copying ‘project2’ files and changing ownership in two separate commands will result in two layers since Docker duplicates all the files twice.
🧐 Question🔧 Skill

Medium

Dockerfile Updates
Cache
2 mins
Docker
Solve

Medium

Efficient Dockerfile
Dockerfile
2 mins
Docker
Solve
🧐 Question🔧 Skill💪 Difficulty⌛ Time
Dockerfile Updates
Cache
Docker
Medium2 mins
Solve
Efficient Dockerfile
Dockerfile
Docker
Medium2 mins
Solve

Adaface questions are trusted by enterprises globally

Amazon Morgan Stanley Vodafone United Nations HCL PayPal Bosch WeWork Optimum Solutions Deloitte Microsoft NCS Doubtnut Sokrati J&T Express Capegemini

We evaluated several of their competitors and found Adaface to be the most compelling. Great default library of questions that are designed to test for fit rather than memorization of algorithms.


Swayam Narain, CTO, Affable

hashtag image heart icon Swayam
Join 1200+ companies in 75+ countries.
Try the most candidate friendly skills assessment tool today.
Ready to streamline your recruitment efforts with Adaface?
Ready to streamline your recruitment efforts with Adaface?
Chat with us
40 min tests.
No trick questions.
Accurate shortlisting.
Ada
Ada
● Online
Previous
Score: NA
Next
✖️