{"id":9109,"date":"2020-01-21T07:12:33","date_gmt":"2020-01-21T07:12:33","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9109"},"modified":"2021-11-13T06:54:41","modified_gmt":"2021-11-13T06:54:41","slug":"docker-interview-questions-and-answer-part-23","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-interview-questions-and-answer-part-23\/","title":{"rendered":"Docker Interview Questions and Answer Part \u2013 23"},"content":{"rendered":"\n<p><strong>Which of the following are top-level keys in a stack file (Compose v3 file)?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Version, deployments, networks, volumes<\/li><li>Version and services<\/li><li><strong>Version, services, networks, volumes (Ans)<\/strong><\/li><li>Services, pods, networks, volumes<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is an advantage of Multi-stage Builds?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Multi-platform images<\/li><li>Better image documentation<\/li><li>Faster image builds<\/li><li><strong>Smaller images (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following is a recommended number of Swarm managers for high availability?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>4<\/li><li><strong>3 (Ans)<\/strong><\/li><li>2<\/li><\/ul>\n\n\n\n<p><strong>Which of the following best describes a Bridge (NAT on Windows) network in Docker?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Token-ring<\/li><li>Multi-host overlay network<\/li><li><strong>A single-host network (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>How does the HRM know how to route traffic to the correct service?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>iptables rules<\/li><li><strong>It inspects HTTP host headers (Ans)<\/strong><\/li><li>DNS labels<\/li><li>Custom load balancer rules<\/li><\/ul>\n\n\n\n<p><strong>By default, where are Docker daemon logs sent to on a Linux system running systemd?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>syslog<\/li><li>The Linux event viewer<\/li><li><strong>journald (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following is a major goal of Docker volumes?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Data replication<\/li><li>Data encryption at-rest<\/li><li>Object storage<\/li><li><strong>Persistent data (Ans)<\/strong><\/li><li>RAID<\/li><\/ul>\n\n\n\n<p><strong>Which are the two major kernel building blocks that containers are built from?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Capabilities and seccomp<\/li><li>Namespaces and kernels<\/li><li>Namespaces and control groups<\/li><li><strong>Capabilities and control groups (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following is a recommended best practice?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Keep your images small (Ans)<\/strong><\/li><li>Never use the latest image in a repo<\/li><li>Use large images containing lots of tools<\/li><li>Only use Docker Hub<\/li><\/ul>\n\n\n\n<p><strong>Where are Secrets mounted on Linux-based Docker hosts?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>An encrypted volume mounted at \/run\/secrets<\/li><li><strong>An in memory (tempfs) volume at \/run\/secrets (Ans)<\/strong><\/li><li>initramfs<\/li><li>Solid state volume<\/li><\/ul>\n\n\n\n<p><strong>How are Docker Secrets created on the command line?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>docker secret create (Ans)<\/strong><\/li><li>docker swarm secret create<\/li><li>They cannot be created on the command line<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is the best high-level description of a Swarm?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>A secure cluster of Docker nodes (Ans)<\/strong><\/li><li>A tightly-coupled cluster of Docker container<\/li><li>A secure cluster of Docker containers<\/li><li>I tightly-coupled cluster of Linux nodes<\/li><\/ul>\n\n\n\n<p><strong>What is the atomic unit of scheduling in Docker?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The service<\/li><li><strong>The container (Ans)<\/strong><\/li><li>The pod<\/li><li>The stack<\/li><li>The swarm<\/li><\/ul>\n\n\n\n<p><strong>Which of the following commands lets you deploy a Docker Stack called stack1 using a Compose file called myapp.yml?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker service deploy -c myapp.yml stack1<\/li><li><strong>docker stack deploy -c myapp.yml stack1 (Ans)<\/strong><\/li><li>docker stack deploy stack1 myapp.yml<\/li><li>docker service deploy stack1 myapp.yml<\/li><\/ul>\n\n\n\n<p><strong>Which of the following open-source tools is the underlying technology for Docker Swarm?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>containerd<\/li><li><strong>SwarmKit (Ans)<\/strong><\/li><li>Kubernetes<\/li><li>InfraKit<\/li><li>The Docker daemon<\/li><\/ul>\n\n\n\n<p><strong>Docker UCP implements RBAC via Grants. Which of the following make up a Grant?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Subjects, roles, and nodes<\/li><li><strong>Subjects, roles, and collections (Ans)<\/strong><\/li><li>Roles and collections<\/li><\/ul>\n\n\n\n<p><strong>Which of the following built-in Docker networks creates a single layer-2 container-only network across multiple Docker hosts that can be on different underlying networks?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Bridge<\/li><li>MACVLAN<\/li><li><strong>Overlay (Ans)<\/strong><\/li><li>NAT<\/li><\/ul>\n\n\n\n<p><strong>Which Docker command shows the network ports that a container is exposed on?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker container ports<\/li><li><strong>docker port (Ans)<\/strong><\/li><li>docker network &#8211;port<\/li><\/ul>\n\n\n\n<p><strong>What happens when you perform a docker volume rm against a volume attached to a running container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>The command will fail (Ans)<\/strong><\/li><li>The volume will be deleted<\/li><li>The volume and the container will be deleted<\/li><li>You will be asked to confirm the command<\/li><\/ul>\n\n\n\n<p><strong>Which set of container-related Linux tools did Docker&#8217;s <code>libcontainer<\/code> replace?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>LXD<\/li><li>libc<\/li><li>AUFS<\/li><li><strong>LXC (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>How can you make a Docker Secret available to a standalone container (not a service replica)?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>You cannot (Ans)<\/strong><\/li><li>Make sure it us running on an overlay network<\/li><li>Make sure it is on a node running in Swarm mode<\/li><\/ul>\n\n\n\n<p><strong>Which Docker technology allows you to manage an entire application comprising multiple Docker Services? <\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Service Mesh<\/li><li><strong>Stacks (Ans)<\/strong><\/li><li>Bundles<\/li><\/ul>\n\n\n\n<p><strong>Which are the two major Docker container orchestrators?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Swarm and VMware vSphere<\/li><li>Swarm and Marathon<\/li><li><strong>Swarm and Kubernetes (Ans)<\/strong><\/li><li>Kubernetes and VMware vSphere<\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_41288\"><iframe loading=\"lazy\"  id=\"_ytid_82010\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_41288\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Which of the following are top-level keys in a stack file (Compose v3 file)? Version, deployments, networks, volumes Version and services Version, services, networks, volumes (Ans) Services, pods, networks, volumes&#8230; <\/p>\n","protected":false},"author":1,"featured_media":9513,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[767,567,766,482],"class_list":["post-9109","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","tag-answer","tag-docker","tag-interview","tag-questions"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=9109"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9109\/revisions"}],"predecessor-version":[{"id":25031,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9109\/revisions\/25031"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/9513"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}