Add basic shell scripting questions
This commit is contained in:
parent
70e2ccc99b
commit
38ab4dc901
110
README.md
110
README.md
@ -7,9 +7,9 @@
|
|||||||
|
|
||||||
:warning: Some answers might be only partial and shouldn't be used as they are in interviews
|
:warning: Some answers might be only partial and shouldn't be used as they are in interviews
|
||||||
|
|
||||||
:exclamation: You don't need to know how to answer all the questions here. DevOps is not about specific set of tools or technologies.
|
:exclamation: You don't need to know how to answer all these questions here. DevOps is not about specific set of tools or techs
|
||||||
|
|
||||||
:exclamation: Some questions are very specific and will be asked only if you are interviewing to a specialized role (e.g. Ansible Expert)
|
:exclamation: Some questions are very specific and will be asked only if you are being interviewed to specialized roles
|
||||||
|
|
||||||
:pencil: You can add more questions & answers by submitting pull requests :)
|
:pencil: You can add more questions & answers by submitting pull requests :)
|
||||||
|
|
||||||
@ -38,6 +38,7 @@
|
|||||||
<td align="center"><a href="#go"><img src="images/go.png" width="75px;" height="75px;" alt="Go"/><br /><b>Go</b></a><br /><sub><a href="#go-beginner">Beginner :baby:</a></sub><br><sub></td>
|
<td align="center"><a href="#go"><img src="images/go.png" width="75px;" height="75px;" alt="Go"/><br /><b>Go</b></a><br /><sub><a href="#go-beginner">Beginner :baby:</a></sub><br><sub></td>
|
||||||
<td align="center"><a href="#mongo"><img src="images/mongo.png" width="75px;" height="75px;" alt="Mongo"/><br /><b>Mongo</b></a><br /><sub><a href="#mongo-beginner">Beginner :baby:</a></sub><br><sub></td>
|
<td align="center"><a href="#mongo"><img src="images/mongo.png" width="75px;" height="75px;" alt="Mongo"/><br /><b>Mongo</b></a><br /><sub><a href="#mongo-beginner">Beginner :baby:</a></sub><br><sub></td>
|
||||||
<td align="center"><a href="#openshift"><img src="images/openshift.png" width="75px;" height="75px;" alt="OpenShift"/><br /><b>OpenShift</b></a><br /><sub><a href="#openshift-beginner">Beginner :baby:</a></sub><br><sub></td>
|
<td align="center"><a href="#openshift"><img src="images/openshift.png" width="75px;" height="75px;" alt="OpenShift"/><br /><b>OpenShift</b></a><br /><sub><a href="#openshift-beginner">Beginner :baby:</a></sub><br><sub></td>
|
||||||
|
<td align="center"><a href="#shell-scripting"><img src="images/bash.png" width="75px;" height="75px;" alt="Bash"/><br /><b>Shell Scripting</b></a><br /><sub><a href="#shell-scripting-beginner">Beginner :baby:</a></sub><br><sub></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</center>
|
</center>
|
||||||
@ -199,6 +200,12 @@ This situation might lead to bugs which hard to identify and reproduce.
|
|||||||
<summary>How to deal with configuration drift?</summary><br><b>
|
<summary>How to deal with configuration drift?</summary><br><b>
|
||||||
</b></details>
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Do you have experience with testing cross-projects changes? (aka cross-dependency)</summary><br><b>
|
||||||
|
|
||||||
|
Note: cross-dependency is when you have two or more changes to separate projects and you would like to test them in mutual build instead of testing each change separately.
|
||||||
|
</b></details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>In what scenarios would you prefer to use SQL?</summary><br><b>
|
<summary>In what scenarios would you prefer to use SQL?</summary><br><b>
|
||||||
|
|
||||||
@ -206,13 +213,6 @@ This situation might lead to bugs which hard to identify and reproduce.
|
|||||||
* ACID compliance is important
|
* ACID compliance is important
|
||||||
</b></details>
|
</b></details>
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>In what scenarios would you prefer to use NoSQL over SQL?</summary><br><b>
|
|
||||||
|
|
||||||
* Heterogeneous data which changes often
|
|
||||||
* Data consistency and integrity is not top priority
|
|
||||||
</b></details>
|
|
||||||
|
|
||||||
|
|
||||||
## Jenkins
|
## Jenkins
|
||||||
|
|
||||||
@ -266,6 +266,13 @@ This situation might lead to bugs which hard to identify and reproduce.
|
|||||||
<summary>If you are managing a dozen of jobs, you can probably use the Jenkins UI. How do you manage the creation and deletion of hundreds of jobs every week/month?</summary><br><b>
|
<summary>If you are managing a dozen of jobs, you can probably use the Jenkins UI. How do you manage the creation and deletion of hundreds of jobs every week/month?</summary><br><b>
|
||||||
</b></details>
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>How would you implement an option of a starting a build from a certain stage and not from the beginning?<summary><br><b>
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>What are some of Jenkins limitations?<summary><br><b>
|
||||||
|
</b></details>
|
||||||
|
|
||||||
## AWS
|
## AWS
|
||||||
|
|
||||||
@ -355,7 +362,7 @@ Stop the instance, the type of the instance to match the desired RAM and start t
|
|||||||
#### :baby: Beginner
|
#### :baby: Beginner
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Explain the OSI model. What layers there are? What each layer reponsible for?</summary><br><b>
|
<summary>Explain the OSI model. What layers there are? What each layer is responsible for?</summary><br><b>
|
||||||
|
|
||||||
Application: user end (HTTP is here)
|
Application: user end (HTTP is here)
|
||||||
Presentation: establishes context between application-layer entities (Encryption is here)
|
Presentation: establishes context between application-layer entities (Encryption is here)
|
||||||
@ -441,6 +448,10 @@ CSMA/CD algorithm:
|
|||||||
<summary>What is ICMP?</summary><br><b>
|
<summary>What is ICMP?</summary><br><b>
|
||||||
</b></details>
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>What is NAT? How it works?</summary><br><b>
|
||||||
|
</b></details>
|
||||||
|
|
||||||
## Linux
|
## Linux
|
||||||
|
|
||||||
<a name="linux-beginner"></a>
|
<a name="linux-beginner"></a>
|
||||||
@ -524,16 +535,6 @@ Each number has different meaning, based on how the application was developed.
|
|||||||
I consider this as a good blog post to read more about it: https://shapeshed.com/unix-exit-codes
|
I consider this as a good blog post to read more about it: https://shapeshed.com/unix-exit-codes
|
||||||
</b></details>
|
</b></details>
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Explain what would be the result of each command:
|
|
||||||
|
|
||||||
* <code>echo $0</code>
|
|
||||||
* <code>echo $?</code>
|
|
||||||
* <code>echo $$</code>
|
|
||||||
* <code>echo $@</code>
|
|
||||||
* <code>echo $#</code></summary><br><b>
|
|
||||||
</b></details>
|
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>How to grep two strings?</summary><br><b>
|
<summary>How to grep two strings?</summary><br><b>
|
||||||
</b></details>
|
</b></details>
|
||||||
@ -573,7 +574,7 @@ hard link can be created only within the same file system.
|
|||||||
<summary>How to run a process in the background and why to do that in the first place?</summary><br><b>
|
<summary>How to run a process in the background and why to do that in the first place?</summary><br><b>
|
||||||
|
|
||||||
You can achieve that by specifying & at end of the command.
|
You can achieve that by specifying & at end of the command.
|
||||||
As to Why? since some commands/processes can take a lot of time to finish
|
As to why, since some commands/processes can take a lot of time to finish
|
||||||
execution or run forever
|
execution or run forever
|
||||||
</b></details>
|
</b></details>
|
||||||
|
|
||||||
@ -1267,6 +1268,13 @@ func main() {
|
|||||||
<a name="mongo-beginner"></a>
|
<a name="mongo-beginner"></a>
|
||||||
#### :baby: Beginner
|
#### :baby: Beginner
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>In what scenarios would you prefer to use NoSQL/Mongo over SQL?</summary><br><b>
|
||||||
|
|
||||||
|
* Heterogeneous data which changes often
|
||||||
|
* Data consistency and integrity is not top priority
|
||||||
|
</b></details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>What is a document? What is a collection?</summary><br><b>
|
<summary>What is a document? What is a collection?</summary><br><b>
|
||||||
</b></details>
|
</b></details>
|
||||||
@ -1308,6 +1316,66 @@ func main() {
|
|||||||
<summary>Explain what is Downward API</summary><br><b>
|
<summary>Explain what is Downward API</summary><br><b>
|
||||||
</b></details>
|
</b></details>
|
||||||
|
|
||||||
|
## Shell Scripting
|
||||||
|
|
||||||
|
<a name="shell-scripting-beginner"></a>
|
||||||
|
#### :baby: Beginner
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Tell me about your experience with shell scripting</summary><br><b>
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>What this line in scripts mean?: <code>#!/bin/bash</code></summary><br><b>
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>What do you tend to include in every script you write?</summary><br><b>
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>True or False?: when a certain command/line fails, the script, by default, will exit and will no keep running</summary><br><b>
|
||||||
|
|
||||||
|
Depends on the language and settings used but in Bash for example, by default the script will keep running.
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Today we have tools and technologies like Ansible. Why would someone still use shell scripting?</summary><br><b>
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Explain what would be the result of each command:
|
||||||
|
|
||||||
|
* <code>echo $0</code>
|
||||||
|
* <code>echo $?</code>
|
||||||
|
* <code>echo $$</code>
|
||||||
|
* <code>echo $@</code>
|
||||||
|
* <code>echo $#</code></summary><br><b>
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>How do you debug shell scripts?</summary><br><b>
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>How do you get input from the user in shell scripts?</summary><br><b>
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Explain conditionals and how do you use them</summary><br><b>
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>What is a loop? What types of loops are you familiar with?</summary><br><b>
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Explain <code>continue</code> and <code>break</code>. When do you use them if at all?</summary><br><b>
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>How do you check variable length?</summary><br><b>
|
||||||
|
</b></details>
|
||||||
|
|
||||||
## Scenarios
|
## Scenarios
|
||||||
|
|
||||||
|
BIN
images/bash.png
Normal file
BIN
images/bash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
10
scenarios/jenkins_pipelines.md
Normal file
10
scenarios/jenkins_pipelines.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
## Jenkins Pipelines
|
||||||
|
|
||||||
|
Write/Create the following Jenkins pipelines:
|
||||||
|
|
||||||
|
* A pipeline which will run unit tests upon git push to a certain repository
|
||||||
|
* A pipeline which will do to the following:
|
||||||
|
|
||||||
|
* Provision an instance (can also be a container)
|
||||||
|
* Configure the instance as Apache web server
|
||||||
|
* Deploy a web application on the provisioned instance
|
5
scenarios/jenkins_scripts.md
Normal file
5
scenarios/jenkins_scripts.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
## Jenkins Scripts
|
||||||
|
|
||||||
|
Write the following scripts:
|
||||||
|
|
||||||
|
* Remove all the jobs which include the string "REMOVE_ME" in their name
|
Loading…
Reference in New Issue
Block a user