This commit is contained in:
abregman 2021-05-18 10:47:27 +03:00
parent b45aa4a2b1
commit 6362c95813
2 changed files with 179 additions and 39 deletions

173
README.md
View File

@ -2,7 +2,7 @@
:information_source:  This repo contains questions and exercises on various technical topics, sometimes related to DevOps and SRE :) :information_source:  This repo contains questions and exercises on various technical topics, sometimes related to DevOps and SRE :)
:bar_chart:  There are currently **1553** questions :bar_chart:  There are currently **1575** questions
:books:  To learn more about DevOps and SRE, check the resources in [devops-resources](https://github.com/bregman-arie/devops-resources) repository :books:  To learn more about DevOps and SRE, check the resources in [devops-resources](https://github.com/bregman-arie/devops-resources) repository
@ -559,16 +559,15 @@ This might be considered to be an opinionated answer:
<details> <details>
<summary>Explain the following: <summary>Explain the following:
* Job - Job
* Build - Build
* Plugin - Plugin
* Slave/Node/Worker - Node or Worker
* Executor</summary><br><b> - Executor</summary><br><b>
- Job is an automation definition = what and where to execute once the user clicks on "build"
* Job is an automation definition = what and where to execute once the user clicks on "build" - Build is a running instance of a job. You can have one or more builds at any given point of time (unless limited by confiugration)
* Build is a running instance of a job. You can have one or more builds at any given point of time (unless limited by confiugration) - A worker is the machine/instance on which the build is running. When a build starts, it "acquires" a worker out of a pool to run on it.
* A worker is the machine/instance on which the build is running. When a build starts, it "acquires" a worker out of a pool to run on it. - An executor is variable of the worker, defining how many builds can run on that worker in parallel. An executor value of 3 means, that 3 builds can run at any point on that executor (not necessarily of the same job. Any builds)
* An executor is variable of the worker, defining how many builds can run on that worker in parallel. An executor value of 3 means, that 3 builds can run at any point on that executor (not necessarily of the same job. Any builds)
</b></details> </b></details>
<details> <details>
@ -741,13 +740,31 @@ It's important to note that:
* Availability zone * Availability zone
* Region * Region
* Edge location</summary><br><b> * Edge location</summary><br><b>
AWS regions are data centers hosted across different geographical locations worldwide, each region is completely independent of one another.<br> AWS regions are data centers hosted across different geographical locations worldwide.<br>
Within each region, there are multiple isolated locations known as Availability Zones. Multiple availability zones ensure high availability in case one of them goes down.<br> Within each region, there are multiple isolated locations known as Availability Zones. Multiple availability zones ensure high availability in case one of them goes down.<br>
Edge locations are basically content delivery network which caches data and insures lower latency and faster delivery to the users in any location. They are located in major cities in the world. Edge locations are basically content delivery network which caches data and insures lower latency and faster delivery to the users in any location. They are located in major cities in the world.
</b></details> </b></details>
<details>
<summary>True or False? Each AWS region is designed to be completely isolated from the other AWS regions </summary><br><b>
True.
</b></details>
<details>
<summary>Do you agree with the statement "AWS region should be chosen based on proximity alone"?</summary><br><b>
Note: opinionated answer.
No. There are a couple of factors to consider when choosing a region (order doesn't mean anything):
1. Cost - regions vary in cost and AWS Price List API can assist in calculating the difference in cost between the different regions.
2. Speed
3. Features
</b></details>
#### AWS IAM #### AWS IAM
<details> <details>
@ -909,11 +926,11 @@ False. Charges are being made when the code is executed.
<details> <details>
<summary>Which of the following set of languages Lambda supports? <summary>Which of the following set of languages Lambda supports?
* R, Swift, Rust, Kotlin - R, Swift, Rust, Kotlin
* Python, Ruby, Go - Python, Ruby, Go
* Python, Ruby, PHP</summary><br><b> - Python, Ruby, PHP</summary><br><b>
* Python, Ruby, Go - Python, Ruby, Go
</b></details> </b></details>
#### AWS Containers #### AWS Containers
@ -3904,10 +3921,6 @@ MemFree - The amount of unused physical RAM in your system
MemAvailable - The amount of available memory for new workloads (without pushing system to use swap) based on MemFree, Active(file), Inactive(file), and SReclaimable. MemAvailable - The amount of available memory for new workloads (without pushing system to use swap) based on MemFree, Active(file), Inactive(file), and SReclaimable.
</b></details> </b></details>
<details>
<summary>What is virtual memory?</summary><br><b>
</b></details>
<details> <details>
<summary>What is the difference between paging and swapping?</summary><br><b> <summary>What is the difference between paging and swapping?</summary><br><b>
</b></details> </b></details>
@ -3935,7 +3948,7 @@ MemAvailable - The amount of available memory for new workloads (without pushing
* Software/Packages Management * Software/Packages Management
</b></details> </b></details>
#### Linux Advanced - Misc #### Linux Misc
<details> <details>
<summary>Wildcards are implemented on user or kernel space?</summary><br><b> <summary>Wildcards are implemented on user or kernel space?</summary><br><b>
@ -3951,6 +3964,18 @@ MemAvailable - The amount of available memory for new workloads (without pushing
<summary>Why there are different sections in man? What is the difference between the sections?</summary><br><b> <summary>Why there are different sections in man? What is the difference between the sections?</summary><br><b>
</b></details> </b></details>
<details>
<summary>What is User-mode Linux?</summary><br><b>
</b></details>
#### Linux Nerds
<details>
<summary>Under which license Linux is distributed? </summary><br><b>
GPL v2
</b></details>
#### Linux Master Application #### Linux Master Application
A completely free application for testing your knowledge on Linux A completely free application for testing your knowledge on Linux
@ -3967,6 +3992,18 @@ There are many ways to answer that. For those who look for simplicity, the book
"responsible for making it easy to run programs (even allowing you to seemingly run many at the same time), allowing programs to share memory, enabling programs to interact with devices, and other fun stuff like that" "responsible for making it easy to run programs (even allowing you to seemingly run many at the same time), allowing programs to share memory, enabling programs to interact with devices, and other fun stuff like that"
</b></details> </b></details>
<details>
<summary>What is "virtual memory" and what purpose it serves?</summary><br><b>
</b></details>
<details>
<summary>What is demand paging?</summary><br><b>
</b></details>
<details>
<summary>What is copy-on-write or shadowing?</summary><br><b>
</b></details>
<details> <details>
<summary>What is a kernel, and what does it do?</summary><br><b> <summary>What is a kernel, and what does it do?</summary><br><b>
@ -6832,10 +6869,30 @@ print("{0:.3f}".format(sum(li)/len(li)))
#### Python Lists #### Python Lists
<details>
<summary>How to add the number 2 to the list <code>x = [1, 2, 3]</code></summary><br><b>
`x.append(2)`
</b></details>
<details>
<summary>How to check how many items a list contains?</summary><br><b>
`len(sone_list)`
</b></details>
<details>
<summary>How to get the last element of a list?</summary><br><b>
`some_list[-1]`
</b></details>
<details> <details>
<summary>How to add the items of [1, 2, 3] to the list [4, 5, 6]?</summary><br><b> <summary>How to add the items of [1, 2, 3] to the list [4, 5, 6]?</summary><br><b>
x = [4, 5, 6] x = [4, 5, 6]
x.extend([1, 2, 3]) x.extend([1, 2, 3])
Don't use `append` unless you would like the list as one item.
</b></details> </b></details>
<details> <details>
@ -6845,12 +6902,11 @@ x.extend([1, 2, 3])
</b></details> </b></details>
<details> <details>
<summary>How do you get the maximum and minimum values from a list? How to get the last item from a list?</summary><br><b> <summary>How do you get the maximum and minimum values from a list?</summary><br><b>
``` ```
Maximum: max(some_list) Maximum: max(some_list)
Minimum: min(some_list) Minimum: min(some_list)
Last item: some_list[-1]
``` ```
</b></details> </b></details>
@ -6995,6 +7051,42 @@ If we call it 3 times, what would be the result each call?
``` ```
</b></details> </b></details>
<details>
<summary>How to iterate over a list?</summary><br><b>
```
for item in some_list:
print(item)
```
</b></details>
<details>
<summary>How to iterate over a list with indexes?</summary><br><b>
```
for i, item in enumerate(some_list):
print(i)
```
</b></details>
<details>
<summary>How to start list iteration from 2nd index?</summary><br><b>
Using range like this
```
for i in range(1, len(some_list)):
some_list[i]
```
Another way is using slicing
```
for i in some_list[1:]:
```
</b></details>
<details> <details>
<summary>How to iterate over a list in reverse order?</summary><br><b> <summary>How to iterate over a list in reverse order?</summary><br><b>
@ -7360,6 +7452,14 @@ def reverse_string(string):
mario mario
</b></details> </b></details>
#### Python Iterators
<details>
<summary>What is an iterator?</summary><br><b>
</b></details>
#### Python Misc
<details> <details>
<summary>Explain data serialization and how do you perform it with Python</summary><br><b> <summary>Explain data serialization and how do you perform it with Python</summary><br><b>
</b></details> </b></details>
@ -7369,11 +7469,19 @@ mario
</b></details> </b></details>
<details> <details>
<summary>What is an iterator?</summary><br><b> <summary>What is a generator? Why using generators?</summary><br><b>
</b></details> </b></details>
<details> <details>
<summary>What is a generator? Why using generators?</summary><br><b> <summary>What would be the output of the following block?
```
for i in range(3, 3):
print(i)
```
</summary><br><b>
No output :)
</b></details> </b></details>
<details> <details>
@ -10936,10 +11044,19 @@ The server didn't receive a response from another server it communicates with in
<summary>When you publish a project, you usually publish it with a license. What types of licenses are you familiar with and which one do you prefer to use?</summary><br><b> <summary>When you publish a project, you usually publish it with a license. What types of licenses are you familiar with and which one do you prefer to use?</summary><br><b>
</b></details> </b></details>
#### Load Balancing #### Load Balancers
<details> <details>
<summary>What is a load balancer?</summary><br><b> <summary>What is a load balancer?</summary><br><b>
A load balancer accepts (or denies) incoming network traffic from a client, and based on some criteria (application related, network, etc.) it distributes those communications out to servers (at least one).
</b></details>
<details>
<summary>What benefits load balancers provide?</summary><br><b>
* Scalability - using a load balancer, you can possibly add more servers in the backend to handle more requests/traffic from the clients, as opposed to using one server.
* Redundancy - if one server in the backend dies, the load balancer will keep forwarding the traffic/requests to the second server so users won't even notice one of the servers in the backend is down.
</b></details> </b></details>
<details> <details>
@ -10967,6 +11084,10 @@ The server didn't receive a response from another server it communicates with in
<summary>What is an Application Load Balancer?</summary><br><b> <summary>What is an Application Load Balancer?</summary><br><b>
</b></details> </b></details>
<details>
<summary>In which scenarios would you use ALB?</summary><br><b>
</b></details>
<details> <details>
<summary>At what layers a load balancer can operate?</summary><br><b> <summary>At what layers a load balancer can operate?</summary><br><b>

View File

@ -1,5 +1,7 @@
## Q&A ## Q&A
The questions I've been asked at least once.
### What is the purpose of repository? ### What is the purpose of repository?
Learning Learning
@ -7,12 +9,12 @@ Learning
### My goal is to prepare for a DevOps interview. How to do that? ### My goal is to prepare for a DevOps interview. How to do that?
I've added a couple of suggestions [here](prepare_for_interview.md)<br> I've added a couple of suggestions [here](prepare_for_interview.md)<br>
Feel free to contribute any ideas and insights you have. Overall, this repository should help you learn some concepts but don't assume at any point that your interview will consist of questions included in this repository.
### How do I become a better DevOps Engineer? ### How do I become a better DevOps Engineer?
That's a great question.<br> That's a great question.<br>
I don't have a definitive answer for this question, but what I feel works for me is to: I don't have a definitive answer for this question, but try the following:
* Practice - doing DevOps tasks/work should be the primary way to become a DevOps engineer (obvisouly) * Practice - doing DevOps tasks/work should be the primary way to become a DevOps engineer (obvisouly)
* Read - Read blogs, books, ... anything that can enrich you about DevOps * Read - Read blogs, books, ... anything that can enrich you about DevOps
@ -23,22 +25,29 @@ I don't have a definitive answer for this question, but what I feel works for me
Because we need more contributors ;) Because we need more contributors ;)
### Where can I find answers to some of the questions in this repository?
1. Search for them using search engines, documentation pages, ... this is part of being a DevOps engineer
2. Use the communities - many people will be happy to help and answer your questions
3. Ask us. If you want, you can contact me or even open an issue that is only a question, that's totally fine :)
### Where the questions and answers are coming from? ### Where the questions and answers are coming from?
Well, from everywhere - past experience, colleagues, contributors, ... But please note we do not allow copying interview questions from interview questions sites to here. There are people who worked hard on adding those to their sites and we respect that. Well, from everywhere - past experience, colleagues, contributors, ... but please note we do not allow copying interview questions from interview questions sites to here. There are people who worked hard on adding those to their sites and we respect that.
### What are the top DevOps skills required for being a DevOps Engineer? ### What are the top DevOps skills required for being a DevOps Engineer?
It's a hard question and the reason is that if you'll ask 20 different people, you'll probably get at least 10 different answers but here is what we believe is common today: It's a hard question and the reason is that if you'll ask 20 different people, you'll probably get at least 10 different answers but here is what I believe is common today:
* OS - DevOps require you good understanding of operating system concepts. The level required is mainly depends on the company although in my opinion it should be the same level. You should understand how the operating system works, how to troubleshoot and debug issues, etc. * OS - DevOps require you good understanding of operating system concepts. The level required is mainly depends on the company although in my opinion it should be the same level. You should understand how the operating system works, how to troubleshoot and debug issues, etc.
* Coding is part of DevOps. The level again depends on the company. Some will require you to know basic level of scripting while others deep understanding of common algorithms, data structure, design patterns etc. * Programming is part of DevOps. The level again depends on the company. Some will require you to know basic level of scripting while others deep understanding of common algorithms, data structure, design patterns etc.
* Cloud and Containers - while not 100% must in all companies/positions, this skill is on the rise every year and many (if not most) of the positions/companies require this skill. This specifically means: AWS/Azure/GCP, Docker, Podman, Kubernetes, ... * Cloud and Containers - while not 100% must in all companies/positions, this skill is on the rise every year and many (if not most) of the positions/companies require this skill. This specifically means: AWS/Azure/GCP, Docker/Podman, Kubernetes, ...
* CI/CD - Be able to to answer questions like "Why do we need CI/CD?" and "What ways and models are there to perform CI/CD?". Eventually, practice assembling such processes and workflow, using whatever tools you feel comfortable with.
### I feel like there are some questions that shouldn't be included in this project ### I feel like there are some questions that shouldn't be included in this project
Is that a question? :) Is that a question? :)
If you don't like some of the questions or think that some questions should be removed you can open an issue or submit a PR and we can discuss it there. We don't have rules against deleting questions If you don't like some of the questions or think that some questions should be removed you can open an issue or submit a PR and we can discuss it there. We don't have rules against deleting questions (for now :P)
### Can I copy the questions from here to my site? ### Can I copy the questions from here to my site?
@ -47,7 +56,7 @@ You can but:
* Not without attribution. Many people worked hard on adding these questions and they deserve a proper credit for their work * Not without attribution. Many people worked hard on adding these questions and they deserve a proper credit for their work
* Not if you plan to make money out of it. Directly or indirectly (e.g. ADS) as this is a free content and we would like it to stay this way :) * Not if you plan to make money out of it. Directly or indirectly (e.g. ADS) as this is a free content and we would like it to stay this way :)
Same goes for copying questions from sites to this repository. We saw it happened already with a couple of pull requests and we rejected them. We will not allow to copy content from people/sites to this repository. Same goes for copying questions from different sources to this repository. We saw it happened already with a couple of pull requests and we rejected them. We will not merge pull requests with copied questions and answers from other sources.
### Can I add questions and/or answers to this project? ### Can I add questions and/or answers to this project?
@ -55,7 +64,8 @@ I'll simply imagine you didn't ask that on an open source project... :)
### Why can't I add installation questions? ### Why can't I add installation questions?
The purpose of the questions in this repository is to make you learn about a certain technology or purpose. I don't believe installation questions like "How to install Jenkins?" for example, teaches you anything value on Jenkins itself. In most cases, I prefer questions added to this repository will have certain educational value for the user. Either regarding a certain concept or even a very general question, but one that will make you research on a certain topic and will make you more familiar with it.
I see little to none value in what is known as "Installation Questions". Let's say I ask you "how to install Jenkins?". Should I conclude from your answer that you are familiar with Jenkins? Is there a value in knowing how to install Jenkins? In my opinion, no.
### Where can I practice coding? ### Where can I practice coding?
@ -65,9 +75,18 @@ Personally, I really like the following sites
* [LeetCode](https://leetcode.com) * [LeetCode](https://leetcode.com)
* [Exercism](https://exercism.io) * [Exercism](https://exercism.io)
### How to learn more about Linux? ### How to learn more DevOps?
I gathered a list of resource [here](https://dev.to/abregman/collection-of-linux-resources-3nhk) I listed some roadmaps in [devops-resources](https://github.com/bregman-arie/devops-resources)
For beginners, I recommend [Linux Journey](https://linuxjourney.com) ### Why some questions repeat themselves?
If you want to deep dive into operating systems internals, I really recommend [Operating Systems: Three Easy Pieces](http://pages.cs.wisc.edu/~remzi/OSTEP)
If you see two identical questions, that's a bug.
If you see two similar questions, that's a feature :D (= it's intentional)
For example:
1. What is horizontal scaling?
2. The act of adding additional instances to the pool to handle scaling is called ________ scaling
You are right, both ask about horizontal scaling but first of all but, it's done from a different angel every time and in addition, I do believe repetition helps you to learn something better in a way where you are not fixed on one way it's asked.