{"id":22732,"date":"2021-07-24T20:11:49","date_gmt":"2021-07-24T20:11:49","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=22732"},"modified":"2025-07-12T05:41:43","modified_gmt":"2025-07-12T05:41:43","slug":"interview-questions-answers-for-docker-and-containers","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/interview-questions-answers-for-docker-and-containers\/","title":{"rendered":"Interview Questions &#038; Answers for Docker and Containers"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Container<\/h1>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">What is a Container? What is it used for?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">How are containers different from virtual machines (VMs)?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">In which scenarios would you use containers and in which you would prefer to use VMs?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Explain Podman or Docker architecture<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Describe in detail what happens when you run <code>podman\/docker run hello-world<\/code>?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What are <code>dockerd, docker-containerd, docker-runc, docker-containerd-ctr, docker-containerd-shim<\/code> ?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Describe difference between cgroups and namespaces<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Describe in detail what happens when you run <code>docker pull image:tag<\/code>?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">How do you run a container?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What <code>podman commit<\/code> does?. When will you use it?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">How would you transfer data from one container into another?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What happens to data of the container when a container exists?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Explain what each of the following commands do:<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>docker run<\/li><li>docker rm<\/li><li>docker ps<\/li><li>docker pull<\/li><li>docker build<\/li><li>docker commit<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">How do you remove old, non running, containers?<\/h3>\n\n\n\n<h1 class=\"wp-block-heading\">Dockerfile<\/h1>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">What is Dockerfile<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What is the difference between ADD and COPY in Dockerfile?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What is the difference between CMD and RUN in Dockerfile?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Do you perform any checks or testing related to your Dockerfile?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Explain what is Docker compose and what is it used for<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Describe the process of using Docker Compose<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Explain Docker interlock<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Where can you store Docker images?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What is Docker Hub?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What is the difference between Docker Hub and Docker cloud?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What is Docker Repository?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Explain image layers<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What best practices are you familiar related to working with containers?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">How do you manage persistent storage in Docker?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">How can you connect from the inside of your container to the localhost of your host, where the container runs?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">How do you copy files from Docker container to the host and vice versa?<\/h3>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_96423\"><iframe loading=\"lazy\"  id=\"_ytid_48212\"  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_96423\"  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>Container What is a Container? What is it used for? How are containers different from virtual machines (VMs)? In which scenarios would you use containers and in which you would&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[],"class_list":["post-22732","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/22732","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=22732"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/22732\/revisions"}],"predecessor-version":[{"id":24249,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/22732\/revisions\/24249"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=22732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=22732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=22732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}