DEV Community

Aisalkyn Aidarova
Aisalkyn Aidarova

Posted on

interveiw questions

  1. What is Docker?

  2. What is a Docker image?

  3. What is a Docker container?

  4. What is the difference between a Docker image and a Docker container?

  5. Why do companies use Docker?

  6. What problem does Docker solve?

  7. Which command lists running Docker containers?

  8. Which command lists all Docker containers?

  9. Which command lists Docker images?

  10. Which command builds a Docker image?

  11. Which command starts a Docker container?

  12. Which command stops a Docker container?

  13. Which command removes a Docker container?

  14. Which command removes a Docker image?

  15. Which command downloads an image from Docker Hub?

  16. Which command uploads an image to Docker Hub?

  17. What is a Dockerfile?

  18. What is the purpose of a Dockerfile?

  19. Which instruction specifies the base image in a Dockerfile?

  20. Which instruction copies files into a Docker image?

  21. Which instruction installs software during the image build?

  22. Which instruction specifies the default command to run?

  23. What is the purpose of EXPOSE in a Dockerfile?

  24. What is a Docker volume?

  25. Why are Docker volumes important?

  26. What is Docker networking?

  27. What is the bridge network in Docker?

  28. What happens when a Docker container stops?

  29. Do Docker containers share the host operating system kernel?

  30. Why are containers faster than virtual machines?

  31. What is Docker Hub?

  32. Why do developers use Docker Hub?

  33. What is a Docker registry?

  34. Is Docker Hub public or private?

  35. What is an official Docker image?

  36. Why should you use official Docker images?

  37. What command logs into Docker Hub?

  38. What command pushes an image to Docker Hub?

  39. What command pulls an image from Docker Hub?

  40. Why would a company use private repositories in Docker Hub?

  41. What does ECR stand for?

  42. What is Amazon ECR?

  43. Why do companies use Amazon ECR instead of Docker Hub?

  44. Is Amazon ECR public or private by default?

  45. Which AWS service commonly pulls images from ECR?

  46. Can Amazon ECR scan images for vulnerabilities?

  47. How do you authenticate Docker with ECR?

  48. What happens if ECR authentication expires?

  49. Why is image scanning important?

  50. What does ECR store?

  51. What does EC2 stand for?

  52. What is an EC2 instance?

  53. Why do companies use EC2?

  54. What operating systems can run on EC2?

  55. What is a key pair in EC2?

  56. Why is SSH used?

  57. What is the default SSH port?

  58. What is the default HTTP port?

  59. What is the default HTTPS port?

  60. What is an Elastic IP?

  61. What is Amazon EBS?

  62. Why are EBS volumes important?

  63. What is an EC2 Security Group?

  64. Why do we use Security Groups?

  65. What happens if port 22 is blocked?

  66. What happens if port 80 is blocked?

  67. What is User Data in EC2?

  68. What is an EC2 AMI?

  69. Why do companies create custom AMIs?

  70. What is the difference between stopping and terminating an EC2 instance?

  71. What does ALB stand for?

  72. What is an Application Load Balancer?

  73. Why do companies use an ALB?

  74. Which OSI layer does ALB operate on?

  75. What protocols does ALB support?

  76. What is a Target Group?

  77. What is a Health Check?

  78. Why are Health Checks important?

  79. What happens if one EC2 instance becomes unhealthy?

  80. Can one ALB route traffic to multiple applications?

  81. What is path-based routing?

  82. What is host-based routing?

  83. Why does an ALB improve availability?

  84. What happens if there is no Load Balancer?

  85. Can ALB distribute traffic across multiple Availability Zones?

  86. What does ASG stand for?

  87. What is an Auto Scaling Group?

  88. Why do companies use Auto Scaling?

  89. What is Scale Out?

  90. What is Scale In?

  91. What is Desired Capacity?

  92. What is Minimum Capacity?

  93. What is Maximum Capacity?

  94. Which AWS service provides metrics for Auto Scaling?

  95. Which metric commonly triggers Auto Scaling?

  96. What happens when CPU usage reaches 90%?

  97. What happens when traffic decreases?

  98. How does Auto Scaling help reduce costs?

  99. Can Auto Scaling replace failed EC2 instances automatically?

  100. Why is Auto Scaling important for production?

  101. What is a CPU?

  102. What is the main function of a CPU?

  103. What does CPU utilization mean?

  104. What happens when CPU usage reaches 100%?

  105. What is RAM?

  106. Why is RAM important?

  107. What happens when RAM is full?

  108. What is swapping?

  109. What is SSD?

  110. What is the difference between SSD and HDD?

  111. Which is faster: SSD or HDD?

  112. Why do companies prefer SSDs?

  113. Which component stores files permanently?

  114. Which component temporarily stores running applications?

  115. Which component performs calculations?

  116. What is hardware?

  117. What is software?

  118. What is firmware?

  119. What is a motherboard?

  120. What is BIOS?

  121. What is UEFI?

  122. What is a GPU?

  123. What is a Network Interface Card (NIC)?

  124. What is a power supply (PSU)?

  125. What is a server?

  126. What is a workstation?

  127. What is a laptop?

  128. What is a peripheral device?

  129. Which components are considered hardware?

  130. Which are examples of software?

  131. What is a network?

  132. What is an IP address?

  133. What is a private IP address?

  134. What is a public IP address?

  135. What is a MAC address?

  136. What is DNS?

  137. What is DHCP?

  138. What is a router?

  139. What is a switch?

  140. What is a firewall?

  141. What is a subnet?

  142. What is a gateway?

  143. What is NAT?

  144. What is ping used for?

  145. What is traceroute used for?

  146. What is latency?

  147. What is bandwidth?

  148. What is packet loss?

  149. What is TCP?

  150. What is UDP?

  151. What is HTTP?

  152. What is HTTPS?

  153. What is FTP?

  154. What is SSH?

  155. What is SSL/TLS?

  156. What is port 22 used for?

  157. What is port 80 used for?

  158. What is port 443 used for?

  159. What is port 53 used for?

  160. What is port 3306 commonly used for?

  161. What does API stand for?

  162. What is an API?

  163. Why do developers use APIs?

  164. What is an API endpoint?

  165. What is a REST API?

  166. What is JSON?

  167. What is XML?

  168. What is an HTTP request?

  169. What is an HTTP response?

  170. What does the GET method do?

  171. What does the POST method do?

  172. What does the PUT method do?

  173. What does the DELETE method do?

  174. What does the PATCH method do?

  175. What is an API client?

  176. What is an API server?

  177. What does HTTP status code 200 mean?

  178. What does HTTP status code 201 mean?

  179. What does HTTP status code 400 mean?

  180. What does HTTP status code 401 mean?

  181. What does HTTP status code 403 mean?

  182. What does HTTP status code 404 mean?

  183. What does HTTP status code 500 mean?

  184. What is authentication?

  185. What is authorization?

  186. What is an API token?

  187. What is a Bearer Token?

  188. What is Postman used for?

  189. What is Swagger/OpenAPI?

  190. Why is API documentation important?

  191. What happens when a developer pushes code to GitHub?

  192. Why is CI/CD important?

  193. What is a build?

  194. What is testing in CI/CD?

  195. What is deployment?

  196. Why do companies use Docker with CI/CD?

  197. Why do companies use ECR with ECS?

  198. Why do companies use ALB with EC2?

  199. How do Auto Scaling and ALB work together?

  200. How do Docker, ECR, EC2, ALB, ASG, APIs, networking, hardware, and software work together in a modern cloud application?

Architecture

                Developer
                    │
            git add .
            git commit
            git push
                    │
                    ▼
              GitHub Repository
                    │
                    ▼
             GitHub Actions (CI/CD)
                    │
        ┌───────────┼────────────┐
        ▼           ▼            ▼
 Build Frontend  Build Backend  Build AI Service
        │           │            │
        ▼           ▼            ▼
 Push to ECR    Push to ECR   Push to ECR
        │           │            │
        └───────────┼────────────┘
                    ▼
              Amazon ECR
                    │
                    ▼
            Amazon ECS Cluster
                    │
        ┌───────────┼────────────┐
        ▼           ▼            ▼
 frontend-service backend-service ai-service
        │           │            │
        ▼           ▼            ▼
     New Tasks   New Tasks    New Tasks
Enter fullscreen mode Exit fullscreen mode

Developer

The developer only does:

git add .

git commit -m "Deploy to Dev"

git push origin main
Enter fullscreen mode Exit fullscreen mode

GitHub Actions

Automatically executes:

Step 1

Checkout latest code

GitHub
↓

Latest Source Code
Enter fullscreen mode Exit fullscreen mode

Step 2

Login to AWS

AWS Credentials
↓

Authenticate
Enter fullscreen mode Exit fullscreen mode

Step 3

Login to Amazon ECR

Docker Login
↓

Amazon ECR
Enter fullscreen mode Exit fullscreen mode

Step 4

Build Frontend

docker build -t frontend ./frontend
Enter fullscreen mode Exit fullscreen mode

Step 5

Tag Frontend

docker tag frontend:latest \
230026708124.dkr.ecr.us-east-1.amazonaws.com/frontend:latest
Enter fullscreen mode Exit fullscreen mode

Step 6

Push Frontend

docker push \
230026708124.dkr.ecr.us-east-1.amazonaws.com/frontend:latest
Enter fullscreen mode Exit fullscreen mode

Step 7

Build Backend

docker build -t backend ./backend
Enter fullscreen mode Exit fullscreen mode

Step 8

Tag Backend

docker tag backend:latest \
230026708124.dkr.ecr.us-east-1.amazonaws.com/backend:latest
Enter fullscreen mode Exit fullscreen mode

Step 9

Push Backend

docker push \
230026708124.dkr.ecr.us-east-1.amazonaws.com/backend:latest
Enter fullscreen mode Exit fullscreen mode

Step 10

Build AI Service

docker build -t ai-service ./ai-service
Enter fullscreen mode Exit fullscreen mode

Step 11

Tag AI Service

docker tag ai-service:latest \
230026708124.dkr.ecr.us-east-1.amazonaws.com/ai-service:latest
Enter fullscreen mode Exit fullscreen mode

Step 12

Push AI Service

docker push \
230026708124.dkr.ecr.us-east-1.amazonaws.com/ai-service:latest
Enter fullscreen mode Exit fullscreen mode

Step 13

Deploy to Dev

aws ecs update-service \
--cluster fde-ai-service \
--service frontend-service \
--force-new-deployment
Enter fullscreen mode Exit fullscreen mode
aws ecs update-service \
--cluster fde-ai-service \
--service backend-service \
--force-new-deployment
Enter fullscreen mode Exit fullscreen mode
aws ecs update-service \
--cluster fde-ai-service \
--service ai-service \
--force-new-deployment
Enter fullscreen mode Exit fullscreen mode

ECS

Amazon ECS notices the deployment.

Old Container

↓

Stop

↓

Pull New Image

↓

Start New Container
Enter fullscreen mode Exit fullscreen mode

This happens independently for:

  • frontend-service
  • backend-service
  • ai-service

Result

Developer

↓

Git Push

↓

GitHub Actions

↓

Docker Build

↓

Amazon ECR

↓

Amazon ECS

↓

Dev Environment Updated
Enter fullscreen mode Exit fullscreen mode

How to explain it in your YouTube video

"The developer never logs into AWS to deploy code. They simply push their changes to GitHub. GitHub Actions builds Docker images for the frontend, backend, and AI service, pushes those images to Amazon ECR, and tells Amazon ECS to start a new deployment. ECS pulls the latest images from ECR, replaces the running containers, and the Dev environment is updated automatically."

One recommendation before you record

For the next version of the project, consider using a dedicated dev branch instead of deploying from main:

feature/login
        │
        ▼
      dev
        │
   GitHub Actions
        │
   Deploy to Dev (ECS)
        │
   Testing / QA
        │
      main
        │
   Production Deployment
Enter fullscreen mode Exit fullscreen mode

That lets you demonstrate a more realistic enterprise workflow where developers merge to dev for testing, and only approved changes reach main for production.

Top comments (0)