Skip to content

Commit

Permalink
Add basic shell scripting questions
Browse files Browse the repository at this point in the history
  • Loading branch information
abregman committed Oct 18, 2019
1 parent 70e2ccc commit 38ab4dc
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 20 deletions.
108 changes: 88 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

: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 :)

Expand Down Expand Up @@ -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="#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="#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>
</table>
</center>
Expand Down Expand Up @@ -200,17 +201,16 @@ This situation might lead to bugs which hard to identify and reproduce.
</b></details>

<details>
<summary>In what scenarios would you prefer to use SQL?</summary><br><b>
<summary>Do you have experience with testing cross-projects changes? (aka cross-dependency)</summary><br><b>

* Homogeneous data, no changes anticipated
* ACID compliance is important
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>
<summary>In what scenarios would you prefer to use NoSQL over SQL?</summary><br><b>
<summary>In what scenarios would you prefer to use SQL?</summary><br><b>

* Heterogeneous data which changes often
* Data consistency and integrity is not top priority
* Homogeneous data, no changes anticipated
* ACID compliance is important
</b></details>


Expand Down Expand Up @@ -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>
</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

Expand Down Expand Up @@ -355,7 +362,7 @@ Stop the instance, the type of the instance to match the desired RAM and start t
#### :baby: Beginner

<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)
Presentation: establishes context between application-layer entities (Encryption is here)
Expand Down Expand Up @@ -441,6 +448,10 @@ CSMA/CD algorithm:
<summary>What is ICMP?</summary><br><b>
</b></details>

<details>
<summary>What is NAT? How it works?</summary><br><b>
</b></details>

## Linux

<a name="linux-beginner"></a>
Expand Down Expand Up @@ -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
</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 to grep two strings?</summary><br><b>
</b></details>
Expand Down Expand Up @@ -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>

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
</b></details>

Expand Down Expand Up @@ -1267,6 +1268,13 @@ func main() {
<a name="mongo-beginner"></a>
#### :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>
<summary>What is a document? What is a collection?</summary><br><b>
</b></details>
Expand Down Expand Up @@ -1308,6 +1316,66 @@ func main() {
<summary>Explain what is Downward API</summary><br><b>
</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

Expand Down
Binary file added images/bash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions scenarios/jenkins_pipelines.md
Original file line number Diff line number Diff line change
@@ -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 changes: 5 additions & 0 deletions scenarios/jenkins_scripts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Jenkins Scripts

Write the following scripts:

* Remove all the jobs which include the string "REMOVE_ME" in their name

0 comments on commit 38ab4dc

Please sign in to comment.