diff --git a/README.md b/README.md index c6b5a79..170594e 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ :information_source:  This repository contains interview questions on various DevOps related topics -:bar_chart:  There are currently **115** interview questions +:bar_chart:  There are currently **124** interview questions :warning:  Some answers might be only partial and shouldn't be used as they are in interviews @@ -34,6 +34,7 @@ Python
Python

Beginner :baby:
Prometheus
Prometheus

Beginner :baby:
Git
Git

Beginner :baby:
Advanced :star: + Go
Go

Beginner :baby:
@@ -321,6 +322,8 @@ True
How to increase RAM for a given EC2 instance?
+ +Stop the instance, the type of the instance to match the desired RAM and start the instance.
@@ -349,6 +352,13 @@ Network questions can be found [here](https://github.com/bregman-arie/computer-n
How do you schedule tasks periodically?
+ +You can use the commands cron and at. +With cron, tasks are scheduled using the following format: + + + +The tasks are stored in a cron file.
@@ -469,6 +479,32 @@ find /some_dir -iname \*.yml -exec sed -i "s/1/2/g" {} \; You can use the commands top and free
+
+How would you split a 50 lines file into 2 files of 25 lines each?
+ +You can use the split command this way: split -l 25 some_file +
+ +
+What is a file descriptor? What file descriptors are you familiar with?
+ +File descriptor, also known as file handler, is a unique number which identifies an open file in the operating system. + +In Linux (and Unix) the first three file descriptors are: + * 0 - the default data stream for input + * 1 - the default data stream for output + * 2 - the default data stream for output related to errors + +This is a great article on the topic: https://www.computerhope.com/jargon/f/file-descriptor.htm +
+ +
+What's an inode?
+ +For each file (and directory) in Linux there is an inode, a data structure which stores metadata +related to the file like its size, owner, permissions, etc. +
+ #### :star: Advanced @@ -510,6 +546,32 @@ Playbook – One or more plays. Each play can be executed on the same or differe Role – Ansible roles allows you to group resources based on certain functionality/service such that they can be easily reused. In a role, you have directories for variables, defaults, files, templates, handlers, tasks, and metadata. You can then use the role by simply specifying it in your playbook. +
+What is an inventory file and how you define one?
+ +An inventory file defines hosts and/or groups of hosts on which Ansible tasks executed upon. + +An example of inventory file: + +192.168.1.2 +192.168.1.3 +192.168.1.4 + +[web_servers] +190.40.2.20 +190.40.2.21 +190.40.2.22 +
+ +
+What is a dynamic inventory file? When you would use one?

+ +A dynamic inventory file tracks hosts from one or more sources like cloud providers and CMDB systems. + +You should use one when using external sources and especially when the hosts in your environment are being automatically
+spun up and shut down, without you tracking every change in these sources. +
+
You want to run Ansible playbook only on specific minor version of your OS, how would you achieve that?
@@ -599,6 +661,25 @@ I'm {{ ansible_hostname }} and my operating system is {{ ansible_distribution } ``` +
+The variable 'whoami' defined in the following places: + + * role defaults -> whoami: mario + * extra vars (variables you pass to Ansible CLI with -e) -> whoami: toad + * host facts -> whoami: luigi + * inventory variables (doesn’t matter which type) -> whoami: browser + +According to variable precedence, which one will be used?
+ +The right answer is ‘toad’. + +Variable precedence is about how variables override each other when they set in different locations. If you didn’t experience it so far I’m sure at some point you will, which makes it a useful topic to be aware of. + +In the context of our question, the order will be extra vars (always override any other variable) -> host facts -> inventory variables -> role defaults (the weakest). + +A full list can be found at the link above. Also, note there is a significant difference between Ansible 1.x and 2.x. +
+ ## Terraform @@ -942,6 +1023,49 @@ Probably good to mention that it's: This is a great article about Octopus merge: http://www.freblogg.com/2016/12/git-octopus-merge.html +## Go + + +#### :baby: Beginner + +
+What are some characteristics of the Go programming language?
+ + * Strong and static typing - the type of the variables can't be changed over time and they have to be defined at compile time + * Simplicity + * Fast compile times + * Built-in concurrency + * Garbage collected + * Platform independant + * Compile to standalone binary - anything you need to run your app will be compiled into one binary. Very useful for version management in run-time. + +Go also has good community. +
+ +
+What libraries of Go have you used?
+ +This should be answered based on your usage but some examples are: + + * fmt - formatted I/O +
+ +
+Write an "hello world" program?
+ +``` +package main + +import { + "fmt" +} + +func main() { + fmt.Println("Hello World") +} +``` +
+ ## Scenarios Scenarios are questions which combine several subjects together. Some scenarios will diff --git a/images/go.png b/images/go.png new file mode 100644 index 0000000..7af7746 Binary files /dev/null and b/images/go.png differ