{"id":9037,"date":"2020-01-20T08:00:05","date_gmt":"2020-01-20T08:00:05","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9037"},"modified":"2021-11-13T07:05:37","modified_gmt":"2021-11-13T07:05:37","slug":"docker-interview-questions-and-answer-part-19","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-interview-questions-and-answer-part-19\/","title":{"rendered":"Docker Interview Questions and Answer Part \u2013 19"},"content":{"rendered":"\n<p><strong>What can you use to run multiple containers from a single YAML file?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Dockerfile<\/li><li>docker run<\/li><li><strong>docker-compose (Ans)<\/strong><\/li><li>docker run containers.yml<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is not a benefit of Virtual Memory?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Use more memory than is physically available<\/li><li>Processes can use memory as if they are the only process running<\/li><li><strong>Compress data stored in memory to increase capacity (Ans)<\/strong><\/li><li>Don&#8217;t have to save entire contents of memory when switching processes<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is not a benefit of a union filesystem for containers?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Decrease startup time for containers with images pre-extracted into an image cache<\/li><li><strong>Save disk space by sharing common files with the host OS filesystem via symbolic links (Ans)<\/strong><\/li><li>Share page cache entries to reduce memory overhead<\/li><li>Save disk space with readonly layers reused among containers<\/li><\/ul>\n\n\n\n<p><strong>What does it mean for two containers to share a network namespace?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>They share the host&#8217;s (or root) network namespace.<\/li><li>They have isolated virtual network adapters.<\/li><li>They share a virtual network but still have isolated virtual network adapters.<\/li><li><strong>They share a single network stack. (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which networking approach would you use if you don&#8217;t trust an application?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Share network with other containers<\/li><li><strong>None  (Ans)<\/strong><\/li><li>Share with host<\/li><li>Virtual network<\/li><\/ul>\n\n\n\n<p><strong>When you create a process with separate namespaces (network, mount, IPC, UTS, PID, and user), what is the net effect?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>It appears as if the process is running on a different machine. (Ans)<\/strong><\/li><li>Processses get their own isolated instances of system resources.<\/li><li>Processes can share system resources.<\/li><\/ul>\n\n\n\n<p><strong>Why do you use tools like Docker, LXC and rkt?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>To kill processes that consume too much of a system resource<\/li><li><strong>To configure the additional isolation necessary to create a container (Ans)<\/strong><\/li><li>To create VMs to isolate processes<\/li><li>To emulate virtual resources per process<\/li><\/ul>\n\n\n\n<p><strong>When a mount namespace is created, what does it contain?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>An empty list of mount points<\/li><li>The list of mount points passed when creating the new mount namespace<\/li><li>A default set of mount points from \/etc\/mountns.defaults<\/li><li><strong>Essentially a copy of the existing filesystem (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What does Layered Responsibility mean?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>You can rely upon others for base layers in container images. (Ans)<\/strong><\/li><li>You can&#8217;t see the layers beneath yours in container images.<\/li><li>You don&#8217;t ever have to see the layers beneath yours in container images.<\/li><li>You need to validate that all layers are built properly when using an image.<\/li><\/ul>\n\n\n\n<p><strong>What is a context switch?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>When the executing process is changed (Ans)<\/strong><\/li><li>When the executing cgroup is changed<\/li><li>When the contents of virtual memory is loaded into physical memory<\/li><li>When the contents of physical memory is swapped to disk<\/li><\/ul>\n\n\n\n<p><strong>What is a substantial reason for moving from a single node to a multi-node cluster?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>It&#8217;s a best practice to use multi-node clusters in production.<\/li><li>It&#8217;s a best practice to run individual containers on individual nodes.<\/li><li><strong>When containers saturate the resources of a single node (Ans)<\/strong><\/li><li>When containers conflict with each other, i.e. port conflicts or file system conflicts<\/li><\/ul>\n\n\n\n<p><strong>Where is there a natural separation in responsibility when building a cluster?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Running apps &amp; running VMs<\/li><li>Node operating system &amp; cluster services<\/li><li>Machine hardware &amp; operating system<\/li><li><strong>Provisioning nodes &amp; running apps (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What is the net effect of a separate network namespace? Each process can have an entirely separate <em>__<\/em> .<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>hostname<\/li><li><strong>IP address (Ans)<\/strong><\/li><li>filesystem<\/li><li>list of processes<\/li><\/ul>\n\n\n\n<p><strong>What runtime or execution environments can be used with a cluster?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Containers<\/li><li>chroot Processes<\/li><li><strong>All of these (Ans)<\/strong><\/li><li>Virtual Machines<\/li><\/ul>\n\n\n\n<p><strong>What does an Image from a site like Docker Hub provide?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A container&#8217;s hostname<\/li><li>The host filesystem to run a container <\/li><li>A container&#8217;s network configuration<\/li><li>The entire host filesystem<\/li><li><strong>A container&#8217;s filesystem (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What is the net effect of a separate IPC namespace? Each process can have an entirely separate ______ .<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>message queue (Ans)<\/strong><\/li><li>IP address<\/li><li>filesystem<\/li><li>list of processes<\/li><li>hostname<\/li><\/ul>\n\n\n\n<p><strong>What does a system container run?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Runs an OS init process, effectively emulating a VM (Ans)<\/strong><\/li><li>Runs a single application<\/li><li>Runs the container runtime<\/li><li>Runs the host OS init process<\/li><\/ul>\n\n\n\n<p><strong>Why are images so valuable?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Manually configuring a hostname for a container is hard work.<\/li><li><strong>Manually building a filesystem for a container is hard work. (Ans)<\/strong><\/li><li>Manually configuring service discovery for a container is hard work.<\/li><li>Manually configuring networking for a container is hard work.<\/li><\/ul>\n\n\n\n<p><strong>What do capabilities isolate?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Privileged operations (Ans)<\/strong><\/li><li>Unprivileged processes<\/li><li>Privileged processes <\/li><li>Unprivileged operations<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is NOT an analogy for namespaces?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>A slice of a pizza per process (Ans)<\/strong><\/li><li>A whole pizza per process<\/li><li>Database<\/li><li>List<\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_31141\"><iframe loading=\"lazy\"  id=\"_ytid_74412\"  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_31141\"  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>What can you use to run multiple containers from a single YAML file? Dockerfile docker run docker-compose (Ans) docker run containers.yml Which of the following is not a benefit of&#8230; <\/p>\n","protected":false},"author":1,"featured_media":10442,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[567],"class_list":["post-9037","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","tag-docker"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9037","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=9037"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9037\/revisions"}],"predecessor-version":[{"id":25048,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9037\/revisions\/25048"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/10442"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}