Skip to content

Commit

Permalink
Merge pull request #208 from MohamedHaroon98/patch-1
Browse files Browse the repository at this point in the history
Fix indentations, format code pieces and answer some questions
  • Loading branch information
Tikam02 committed Nov 25, 2023
2 parents 7e966ae + f51b93f commit 0ae8929
Showing 1 changed file with 70 additions and 59 deletions.
129 changes: 70 additions & 59 deletions Interview/Dev-ops-Interview.md
Expand Up @@ -197,7 +197,7 @@
- Q18) Draw a comparison between Asset Management and Configuration Management.
- A: The process of monitoring as well as maintaining things of value to an entity or group is called an Asset Management.

- Configuration Management refers to the process of controlling, identifying, planning for, and verifying the configuration items within service in support of Change Management.
- Configuration Management refers to the process of controlling, identifying, planning for, and verifying the configuration items within service in support of Change Management.

- Q19) Can you state and explain various key elements of continuous testing?
- A: Various key elements of continuous testing are:
Expand All @@ -210,17 +210,17 @@
- Test optimization – Improve the overall testing process

- Q20) Please explain the core operations of DevOps in terms of development and infrastructure.
- A: Core operations of DevOps in terms of development and infrastructure are:

- Application development – Developing a product that is able to meet all customer requirements and offers a remarkable level of quality
- Code coverage – Measurement of the total number of blocks or lines or arcs of the code executed while the automated tests are running
- Code developing – Prepare the code base required for the product development
- Configuration – Allowing the product to be used in an optimum way
- Deployment – Installing the software to be used by the end-user
- Orchestration – Arrangement of several automated tasks
- Packaging – Activities involved when the release is ready for deployment
- Provisioning – Ensuring that the infrastructure changes arrive just-in-time with the code that requires it
- Unit testing – Meant for testing individual units or components
- A: Core operations of DevOps in terms of development and infrastructure are:
- Application development – Developing a product that is able to meet all customer requirements and offers a remarkable level of quality
- Code coverage – Measurement of the total number of blocks or lines or arcs of the code executed while the automated tests are running
- Code developing – Prepare the code base required for the product development
- Configuration – Allowing the product to be used in an optimum way
- Deployment – Installing the software to be used by the end-user
- Orchestration – Arrangement of several automated tasks
- Packaging – Activities involved when the release is ready for deployment
- Provisioning – Ensuring that the infrastructure changes arrive just-in-time with the code that requires it
- Unit testing – Meant for testing individual units or components

- Q21) What Do You Know about DevOps?

Expand Down Expand Up @@ -290,9 +290,6 @@

- Start by talking about the age-old mechanisms of writing commands onto script files and testing them in a separate environment before deployment and how this approach is being replaced by IaC. Similar to the codes written for other services, with the help of AWS, IaC allows developers to write, test, and maintain infrastructure entities in a descriptive manner, using formats such as JSON or YAML. This enables easier development and faster deployment of infrastructure changes.

- Go through this Simplilearn video on “DevOps Interview Questions” delivered by our DevOps certification expert that will help you crack any interview.



- Q32) What are the success factors for Continuous Integration?
- Examples of answers:
Expand All @@ -309,17 +306,17 @@

- Q33) How would you implement CI (continuous delivery) - end to end, including source control, branches, tools, etc. ?

- Q34) What is Continious Delivery? Continious Deployment?
- Q34) What is Continuous Delivery? Continuous Deployment?

- Q35) What is the difference between Continuous Integration, Continious Delivery and Continious Deployment?
- Q35) What is the difference between Continuous Integration, Continuous Delivery and Continuous Deployment?

- Q36) What’s the difference between git and github ? What about git and SVN ?
- Q36) What is the difference between git and github ? What about git and SVN ?

- Q37) What is git rebase?

- Q38) In Git how do you revert a commit that has already been pushed and made public?

- Q39) What is puppet/chef/ansible used for? What are the advantages over shell scripts ?
- Q39) What is puppet/chef/ansible used for? What are the advantages over shell scripts ?

- Q40) What do you understand by “Infrastructure as code”? How does it fit into the DevOps methodology? What purpose does it achieve?

Expand Down Expand Up @@ -373,7 +370,6 @@
- Feature branching vs trunk based development
- Advantages of requiring pull requests and approvals

- Q11) More on Front-end Developer Job Interview Questions


***********
Expand Down Expand Up @@ -526,11 +522,18 @@


- Q1) What is the importance of SSL?
- A: Using SSL ensure the security of the communication between server and client by encrypting the messages going bothways making sure even if the message are intercepted the attacker wouldn't be able to decrypt the messages.

- Q2) What is a SQL injection?
- A: an attack that targets SQL database management systems by injecting SQL queries in a way that they are executed by the database. The goal is to manipulate the application's SQL query logic to gain unauthorized access to the database or retrieve, modify, or delete data.

- Q3) What is cross-site scripting (XSS)?

- A: a web security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users. It occurs when a web application allows user input to be included in a web page without proper validation or escaping.
- Stored XSS:
Malicious scripts are permanently stored on the target server, and every user who views the affected page is exposed to the attack.
- Reflected XSS:
The injected script is reflected off a web server, such as in a URL, and executed immediately when the victim opens a manipulated link.

- Q4) Why shouldn’t you roll your own crypto?

- Q5) How are passwords stored on databases?
Expand All @@ -549,21 +552,29 @@

## Docker

- Q1) What is docker for?
- Q1) What is docker used for?
- A: Docker is a tool that allows the creation, deletion, running and storing containers.

- Q2) How to ask docker cli to show all containers&
- Q2) How to show all containers on your system using docker?
- A: `docker ps -a`

- Q3) How to delete image with container, who use this image?
- Q3) How to delete an image that is already being used by a container?
- A: `docker rmi -f`

- Q4) What command help you to delete all old unused images?
- A: `docker image prune -f`

- Q5) What is docker-compose? What is docker-compose.yml?

- Q6) How to expose ports in docker-compose file?

- Q7) How to reduce docker images?
- Using Multistage builds
- using minimal base images
- use as few layers as possible by reducing/combining Dockerfile commands

- Q8) Where you can store docker images?
- A: using a container registry like AWS ECR

- Q9) What is alpine and why we need it?

Expand All @@ -573,78 +584,78 @@
## kubernetes

- Q1) What is Kubernetes?
-A: Kubernetes is an open-source container management tool that holds the responsibilities of container deployment, scaling & descaling of containers & load balancing. Being Google’s brainchild, it offers excellent community and works brilliantly with all the cloud providers. So, we can say that Kubernetes is not a containerization platform, but it is a multi-container management solution.
- A: Kubernetes is an open-source container management tool that holds the responsibilities of container deployment, scaling & descaling of containers & load balancing. Being Google’s brainchild, it offers excellent community and works brilliantly with all the cloud providers. So, we can say that Kubernetes is not a containerization platform, but it is a multi-container management solution.

- Q2) How is Kubernetes related to Docker?
-A: It’s a known fact that Docker provides the lifecycle management of containers and a Docker image builds the runtime containers. But, since these individual containers have to communicate, Kubernetes is used. So, Docker builds the containers and these containers communicate with each other via Kubernetes. So, containers running on multiple hosts can be manually linked and orchestrated using Kubernetes.
- A: It’s a known fact that Docker provides the lifecycle management of containers and a Docker image builds the runtime containers. But, since these individual containers have to communicate, Kubernetes is used. So, Docker builds the containers and these containers communicate with each other via Kubernetes. So, containers running on multiple hosts can be manually linked and orchestrated using Kubernetes.

-Q3) What is Container Orchestration?
-A: Consider a scenario where you have 5-6 microservices for an application. Now, these microservices are put in individual containers, but won’t be able to communicate without container orchestration. So, as orchestration means the amalgamation of all instruments playing together in harmony in music, similarly container orchestration means all the services in individual containers working together to fulfill the needs of a single server.\
- Q3) What is Container Orchestration?
- A: Consider a scenario where you have 5-6 microservices for an application. Now, these microservices are put in individual containers, but won’t be able to communicate without container orchestration. So, as orchestration means the amalgamation of all instruments playing together in harmony in music, similarly container orchestration means all the services in individual containers working together to fulfill the needs of a single server.\

-Q4) What do you know about clusters in Kubernetes?
-A: The fundamental behind Kubernetes is that we can enforce the desired state management, by which I mean that we can feed the cluster services of a specific configuration, and it will be up to the cluster services to go out and run that configuration in the infrastructure.
- Q4) What do you know about clusters in Kubernetes?
- A: The fundamental behind Kubernetes is that we can enforce the desired state management, by which I mean that we can feed the cluster services of a specific configuration, and it will be up to the cluster services to go out and run that configuration in the infrastructure.
So, as you can see in the above diagram, the deployment file will have all the configurations required to be fed into the cluster services. Now, the deployment file will be fed to the API and then it will be up to the cluster services to figure out how to schedule these pods in the environment and make sure that the right number of pods are running.

So, the API which sits in front of services, the worker nodes & the Kubelet process that the nodes run, all together make up the Kubernetes Cluster.

-Q5) How to do maintenance activity on the K8 node?
-A:Whenever there are security patches available the Kubernetes administrator has to perform the maintenance task to apply the security patch to the running container in order to prevent it from vulnerability, which is often an unavoidable part of the administration. The following two commands are useful to safely drain the K8s node.
- Q5) How to do maintenance activity on the K8s node?
- A: Whenever there are security patches available the Kubernetes administrator has to perform the maintenance task to apply the security patch to the running container in order to prevent it from vulnerability, which is often an unavoidable part of the administration. The following two commands are useful to safely drain the K8s node.

kubectl cordon
kubectl drain –ignore-daemon set
`kubectl cordon`
`kubectl drain –ignore-daemon set`
The first command moves the node to maintenance mode or makes the node unavailable, followed by kubectl drain which will finally discard the pod from the node. After the drain command is a success you can perform maintenance.

Note: If you wish to perform maintenance on a single pod following two commands can be issued in order:

kubectl get nodes: to list all the nodes
kubectl drain <node name>: drain a particular node
`kubectl get nodes` to list all the nodes
`kubectl drain <node name>` drain a particular node

-Q6) What is the role of Load Balance in Kubernetes?
-A: Load balancing is a way to distribute the incoming traffic into multiple backend servers, which is useful to ensure the application available to the users.
- Q6) What is the role of Load Balance in Kubernetes?
- A: Load balancing is a way to distribute the incoming traffic into multiple backend servers, which is useful to ensure the application available to the users.
In Kubernetes, as shown in the above figure all the incoming traffic lands to a single IP address on the load balancer which is a way to expose your service to outside the internet which routes the incoming traffic to a particular pod (via service) using an algorithm known as round-robin. Even if any pod goes down load balances are notified so that the traffic is not routed to that particular unavailable node. Thus load balancers in Kubernetes are responsible for distributing a set of tasks (incoming traffic) to the pods

-Q7) How to monitor the Kubernetes cluster?
-A: Prometheus is used for Kubernetes monitoring. The Prometheus ecosystem consists of multiple components.
- Q7) How to monitor the Kubernetes cluster?
- A: Prometheus is used for Kubernetes monitoring. The Prometheus ecosystem consists of multiple components.

Mainly Prometheus server which scrapes and stores time-series data.
Client libraries for instrumenting application code.
Push gateway for supporting short-lived jobs.
Special-purpose exporters for services like StatsD, HAProxy, Graphite, etc.
An alert manager to handle alerts on various support tools

-Q8) Can you explain the differences between Docker Swarm and Kubernetes?
-A: Below are the main difference between Kubernetes and Docker:
- Q8) Can you explain the differences between Docker Swarm and Kubernetes?
- A: Below are the main difference between Kubernetes and Docker:

The installation procedure of the K8s is very complicated but if it is once installed then the cluster is robust. On the other hand, the Docker swarm installation process is very simple but the cluster is not at all robust.
Kubernetes can process the auto-scaling but the Docker swarm cannot process the auto-scaling of the pods based on incoming load.
Kubernetes is a full-fledged Framework. Since it maintains the cluster states more consistently so autoscaling is not as fast as Docker Swarm.

-Q9) How can containers within a pod communicate with each other?
-A: Containers within a pod share networking space and can reach other on localhost. For instance, if you have two containers within a pod, a MySQL container running on port 3306, and a PHP container running on port 80, the PHP container could access the MySQL one through localhost:3306.
- Q9) How can containers within a pod communicate with each other?
- A: Containers within a pod share networking space and can reach other on localhost. For instance, if you have two containers within a pod, a MySQL container running on port 3306, and a PHP container running on port 80, the PHP container could access the MySQL one through localhost:3306.

-Q10) Explain what is a Master Node and what component does it consist of?
-A: The master node is the most vital component responsible for Kubernetes architecture
- Q10) Explain what is a Master Node and what component does it consist of?
- A: The master node is the most vital component responsible for Kubernetes architecture
It is the central controlling unit of Kubernetes and manages workload and communications across the clusters
The master node has various components, each having its process. They are:
-ETCD
-Controller Manager
-Scheduler
-API Server

ETCD (Cluster store):
-This component stores the configuration details and essential values
-It communicates with all other components to receive the commands and work in order to perform an action
-It also manages network rules and posts forwarding activity
- ETCD (Cluster store):
-This component stores the configuration details and essential values
-It communicates with all other components to receive the commands and work in order to perform an action
-It also manages network rules and posts forwarding activity

- Controller Manager
-It is responsible for most of the controllers and performs a task
-It is a daemon which runs in a continuous loop and is responsible for collecting and sending information to API server
-The key controllers handle nodes, endpoints, etc.

Controller Manager
-It is responsible for most of the controllers and performs a task
-It is a daemon which runs in a continuous loop and is responsible for collecting and sending information to API server
-The key controllers handle nodes, endpoints, etc.

Scheduler:
-It is one of the key components of the master node associated with the distribution of workload
-The scheduler is responsible for workload utilization and allocating pod to a new node
-The scheduler should have an idea of the total resources available as well as resources allocated to existing workloads on each node
- Scheduler:
-It is one of the key components of the master node associated with the distribution of workload
-The scheduler is responsible for workload utilization and allocating pod to a new node
-The scheduler should have an idea of the total resources available as well as resources allocated to existing workloads on each node


**********************
Expand Down

0 comments on commit 0ae8929

Please sign in to comment.