diff --git a/README.md b/README.md
index c0de738..e4ced27 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
:information_source: This repo contains questions and exercises on various technical topics, sometimes related to DevOps and SRE :)
-:bar_chart: There are currently **950** questions
+:bar_chart: There are currently **999** questions
:warning: You can use these for preparing for an interview but most of the questions and exercises don't represent an actual interview. Please read [Q&A](common-qa.md) for more details
@@ -329,10 +329,10 @@ Note: cross-dependency is when you have two or more changes to separate projects
-Are you familiar with "The Cathedral and the Bazaar"? Explain each of the models
+Are you familiar with "The Cathedral and the Bazaar models"? Explain each of the models
* Cathedral - source code released when software is released
-* Bazaar - source code is always available publicly
+* Bazaar - source code is always available publicly (e.g. Linux Kernel)
## Jenkins
@@ -1209,8 +1209,8 @@ An open question. Answer based on your real experience. You can highlight one or
* rmdir (can you achieve the same result by using rm
?)
* grep
* wc
- * curl
* touch
+ * whoami
* man
* nslookup or dig
* pwd
@@ -1221,8 +1221,8 @@ An open question. Answer based on your real experience. You can highlight one or
* rmdir - remove directories but you should mention it's possible to use rm for that
* grep - print lines that match patterns. Could be nice to mention -v, -r, -E flags
* wc - print newline, word, and byte counts
- * curl - tranfer a URL or mention common usage like downloading files, API calls, ...
* touch - update timestamps but common usage is to create files
+ * whoami - current logged-in user
* man - reference manuals
* nslookup or dig - query nameservers
* pwd - print working directory
@@ -1239,6 +1239,20 @@ An open question. Answer based on your real experience. You can highlight one or
* cd -
+
+How to rename the name of a file or a directory?
+
+mv command.
+
+
+
+Explain each field in the output of `ls -l` command
+
+
+
+What are hidden files/directories? How to list them?
+
+
Running the command df
you get "command not found". What could be wrong and how to fix it?
@@ -1276,9 +1290,9 @@ Alternatively if you are using a distro with systemd it's recommended to use sys
-Have you scheduled tasks in the past? What kind of tasks?
+How to check which commands you executed in the past?
-Normally you will schedule batch jobs.
+history command or .bash_history file
##### Permissions
@@ -1304,6 +1318,10 @@ Using the `chmod` command.
+
+What this command does? chmod +x some_file
+
+
Explain what is setgid and setuid
@@ -1312,6 +1330,14 @@ Using the `chmod` command.
What is the purpose of sticky bit?
+
+What the following commands do?
+
+ * chmod
+ * chown
+ * chgrp
+
+
You try to delete a file but it fails. Name at least three different reason as to why it could happen
@@ -1347,10 +1373,6 @@ Hardware -> Kernel -> Daemons, System Libraries, Server Display.
Describe how to make a certain process/app a service
-
-How do you kill a process in D state?
-
-
##### Debugging (Beginner)
@@ -1428,10 +1450,6 @@ Hardware -> Kernel -> Daemons, System Libraries, Server Display.
Explain user space and kernel space
-
-Wildcards are implemented on user or kernel space?
-
-
What is KVM?
@@ -1452,10 +1470,38 @@ Hardware -> Kernel -> Daemons, System Libraries, Server Display.
Explain redirection
+#### Linux - Globbing, Wildcards
+
+
+What is Globbing?
+
+
What are wildcards? Can you give an example of how to use them?
+
+Explain what will ls [XYZ]
match
+
+
+
+Explain what will ls [^XYZ]
match
+
+
+
+Explain what will ls [0-5]
match
+
+
+
+What each of the following matches
+
+ * ?
+ * *
+
+ * The ? matches any single character
+ * The * matches zero or more characters
+
+
What do we grep for in each of the following commands?:
@@ -1469,6 +1515,14 @@ Hardware -> Kernel -> Daemons, System Libraries, Server Display.
3. Lines which end with a number
+
+What is the difference single and double quotes?
+
+
+
+What is escaping? What escape character is used for escaping?
+
+
Tell me everything you know about the Linux boot process
@@ -1605,6 +1659,7 @@ True
* /tmp
* /var/log
* /bin
+ * /home
* /usr/local
@@ -1673,6 +1728,10 @@ Zombie (z)
+
+How do you kill a process in D state?
+
+
What is a zombie process?
@@ -1740,10 +1799,6 @@ You can use the commands top
and free
The ls executable is built for an incompatible architecture.
-
-What is escaping? What escape character is used for escaping?
-
-
How would you split a 50 lines file into 2 files of 25 lines each?
@@ -1854,8 +1909,8 @@ Technically, yes.
How can you send an HTTP request from your shell?
-
-Using nc is one way
+
+Using nc is one way
@@ -1884,13 +1939,14 @@ One way would be `ping6 ff02::1`
You can specify one or more of the following:
* dig
+ * host
* nslookup
##### Packaging
-Do you have experience with packaging? Can you explain how does it works?
+Do you have experience with packaging? (as in building packages) Can you explain how does it works?
@@ -1902,7 +1958,7 @@ You can specify one or more of the following:
-How to know to which package a file on the system belongs to? Is it a problem if it doesn't belongs to a package?
+How to know to which package a file on the system belongs to? Is it a problem if it doesn't belongs to any package?
@@ -1913,6 +1969,17 @@ You can specify one or more of the following:
What is an archive? How do you create one in Linux?
+
+How to extract the content of an archive?
+
+
+
+Why do we need package managers? Why not simply creating archives and publish them?
+
+Package managers allow you to manage packages lifecycle as in installing, removing and update the packages.
+In addition, you can specify in a spec how a certain package will be installed - where to copy the files, which commands to run prior to the installation, post the installation, etc.
+
+
##### Applications and Services
@@ -1965,7 +2032,15 @@ Upstart: add Upstart init script at /etc/init/service.conf
How to add a new user to the system without providing him the ability to log-in into the system?
- * adduser user_name --shell=/bin/false --no-create-home
+`adduser user_name --shell=/bin/false --no-create-home`
+You can also add a user and then edit /etc/passwd.
+
+
+
+How to switch to another user? How to switch to root?
+
+su command.
+Use su - to switch to root
@@ -1978,7 +2053,13 @@ Re-install the OS IS NOT the right answer :)
What is sudo? How do you set it up?
-#### Random
+
+How to see a list of who logged-in to the system?
+
+Using the last command.
+
+
+#### Linux - Random
Give 5 commands which are two letters long
@@ -1986,11 +2067,18 @@ Re-install the OS IS NOT the right answer :)
ls, wc, dd, df, du, ps, ip, cp, cd ...
+
+How `cd -` works? How does it knows the previous location?
+
+$OLDPWD
+
+
List three ways to print all the files in the current directory
* ls
* find .
+* echo *
@@ -2002,7 +2090,19 @@ ls, wc, dd, df, du, ps, ip, cp, cd ...
-Explain "environment variables"
+What is the difference between man and info?
+
+A good answer can be found [here](https://askubuntu.com/questions/9325/what-is-the-difference-between-man-and-info-documentation)
+
+
+
+Explain "environment variables". How do you list all environment variables?
+
+
+
+How to create your own environment variables?
+
+`X=2` for example. But this will persist to new shells. To have it in new shells as well, use `export X=2`
@@ -2025,23 +2125,29 @@ It's used in commands to mark the end of commands options. One common example is
What commands you can use for searching files and/or directories?
* find
- * whereis
* locate
+
+How can you check what is the path of a certain command?
+
+ * whereis
+ * which
+
+
#### :star: Advanced
#### System Calls
-Explain the fork system call
+Explain the fork() system call
fork() is used for creating a new process. It does so by cloning the calling process but the child process has its own PID and any memory locks, I/O operations and semaphores are not inherited.
-Explain the exec system call
+Explain the exec() system call
@@ -2073,6 +2179,15 @@ Executes a program. The program is passed as a filename (or path) and must be a
What is the return value of malloc?
+
+Explain the pipe() system call. What does it used for?
+
+[Unix pipe implementation](https://toroid.org/unix-pipe-implementation)
+
+"Pipes provide a unidirectional interprocess communication channel. A pipe has a read end and a write end. Data written to the write end of a pipe can be read from the read end of the pipe.
+A pipe is created using pipe(2), which returns two file descriptors, one referring to the read end of the pipe, the other referring to the write end."
+
+
What happens when you execute ls -l
?
@@ -2211,6 +2326,16 @@ MemAvailable - The amount of available memory for new workloads (without pushing
* Software/Packages Management
+#### Linux Advanced - Misc
+
+
+Wildcards are implemented on user or kernel space?
+
+
+
+Why there are different sections in man? What is the difference between the sections?
+
+
## Operating System
@@ -3893,6 +4018,10 @@ list(zip(nums, letters))
```
+
+What is List Comprehension? Is it better than a typical loop? Why? Can you demonstrate how to use it?
+
+
#### Dictionaries
@@ -4031,10 +4160,6 @@ set([food for bro in x for food in bro['food']])
```
-
-What is List Comprehension? Is it better than a typical loop? Why? Can you demonstrate how to use it?
-
-
#### Python Strings
@@ -5345,22 +5470,37 @@ If Python, then using pdb is very useful.
Using the keyword read
so for example read x
will wait for user input and will store it in the variable x.
-
-What is globbing?
-
-
Explain conditionals and how do you use them
+#### Shell Scripting - Loops
+
What is a loop? What types of loops are you familiar with?
+
+Demonstrate how to use loops
+
+
Explain continue
and break
. When do you use them if at all?
+
+
+Running the following bash script, we don't get 2 as a result, why?
+
+```
+x = 2
+echo $x
+```
+
+
+Should be `x=2`
+
+
How to store the output of a command in a variable?
@@ -5369,16 +5509,12 @@ Using the keyword read
so for example read x
will wait
How do you check variable length?
-
-What is the difference between single and double quotes?
-
+##### Practical
Write a script which will list the differences between two directories
-##### Practical
-
Write a script to determine whether a host is up or down
@@ -5727,6 +5863,36 @@ Azure AD is a cloud-based identity service. You can use it as a standalone servi
Tell me what do you know about GCP networking
+
+Explain Cloud Functions
+
+
+
+What is Cloud Datastore?
+
+
+
+What network tags are used for?
+
+
+
+What are flow logs? Where are they enabled?
+
+
+
+How do you list buckets?
+
+
+
+What Compute metadata key allows you to run code at startup?
+
+startap-script
+
+
+
+What the following commands does? `gcloud deployment-manager deployments create`
+
+
## OpenStack
@@ -5741,17 +5907,48 @@ Azure AD is a cloud-based identity service. You can use it as a standalone servi
-Can you tell me what each of the following components/projects is responsible for?:
+Can you tell me what each of the following services/projects is responsible for?:
* Nova
* Neutron
* Cinder
* Glance
* Keystone
+
+ * Nova - Manage virtual instances
+ * Cinder - Block Storage
+ * Keystone - Authentication service across the cloud
-Describe in detail how you bring up an instance with an IP you can reach from outside the cloud
+Identify the service/project used for each of the following:
+
+ * Copy or snapshot instances
+ * GUI for viewing and modifying resources
+ * Block Storage
+ * Manage virtual instances
+
+
+ * Glance - Copy or snapshot instances
+ * Horizon - GUI for viewing and modifying resources
+ * Cinder - Block Storage
+ * Nova - Manage virtual instances
+
+
+
+What is a tenant/project?
+
+
+
+Determine true or false:
+
+ * OpenStack is free to use
+ * The service responsible for networking is Glance
+ * The purpose of tenant/project is to share resources between different projects and users of OpenStack
+
+
+
+Describe in detail how you bring up an instance with a floating IP
@@ -5771,10 +5968,61 @@ Azure AD is a cloud-based identity service. You can use it as a standalone servi
-Are you familiar with TripleO? What benefits it has?
+Are you familiar with TripleO? How is it different from Devstack?
-##### Networking
+#### OpenStack Compute
+
+
+Can you describe Nova in detail?
+
+ * Used to provision and manage virtual instances
+ * It supports Multi-Tenancy in different levels - logging, end-user control, auditing, etc.
+ * Highly scalable
+ * Authentication can be done using internal system or LDAP
+ * Supports multiple types of block storage
+ * Tries to be hardware and hypervisor agnostice
+
+
+
+What do you know about Nova architecture and components?
+
+ * nova-api - the server which serves metadata and compute APIs
+ * the different Nova components communicate by using a queue (Rabbitmq usually) and a database
+ * a request for creating an instance is inspected by nova-scheduler which determines where the instance will be created and running
+ * nova-compute is the component responsible for communicating with the hypervisor for creating the instance and manage its lifecycle
+
+
+#### OpenStack Networking (Neutron)
+
+
+Explain Neutron in detail
+
+ * One of the core component of OpenStack and a standalone project
+ * Neutron focused on delivering networking as a service
+ * With Neutron, users can set up networks in the cloud and configure and manage a variety of network services
+ * Neutron interacts with:
+ * Keystone - authorize API calls
+ * Nova - nova communicates with neutron to plug NICs into a network
+ * Horizon - supports networking entities in the dashboard and also provides topology view which includes networking details
+
+
+
+Explain each of the following components:
+
+ * neutron-dhcp-agent
+ * neutron-l3-agent
+ * neutron-metering-agent
+ * neutron-*-agtent
+ * neutron-server
+
+
+ * neutron-l3-agent - L3/NAT forwarding (provides external network access for VMs for example)
+ * neutron-dhcp-agent - DHCP services
+ * neutron-metering-agent - L3 traffic metering
+ * neutron-*-agtent - manages local vSwitch configuration on each compute (based on chosen plugin)
+ * neutron-server - exposes networking API and passes requests to other plugins if required
+
What is a provider network?
@@ -5808,19 +6056,181 @@ Azure AD is a cloud-based identity service. You can use it as a standalone servi
How do you debug OpenStack networking issues? (tools, logs, ...)
+#### OpenStack - Keystone
+
+
+Can you describe the following concepts in regards to Keystone?
+
+ * Role
+ * Tenant/Project
+ * Service
+ * Endpoint
+ * Token
+
+ * Role - A list of rights and privileges determining what a user or a project can perform
+ * Tenant/Project - Logical representation of a group of resources isolated from other groups of resources. It can be an account, organization, ...
+ * Service - An endpoint which the user can use for accessing different resources
+ * Endpoint - a network address which can be used to access a certain OpenStack service
+ * Token - Used for access resources while describing which resources can be accessed by using a scope
+
+
+
+What are the properties of a service? In other words, how a service is identified?
+
+Using:
+ * Name
+ * ID number
+ * Type
+ * Description
+
+
+
+Explain the following:
+ * PublicURL
+ * InternalURL
+ * AdminURL
+
+ * PublicURL - Publicly accessible through public internet
+ * InternalURL - Used for communication between services
+ * AdminURL - Used for administrative management
+
+
+
+What is a service catalog?
+
+A list of services and their endpoints
+
+
#### :baby: Advanced
-##### Networking
+#### OpenStack Advanced - Services
-Explain BGP dynamic routing
+Describe each of the following services
+
+ * Swift
+ * Sahara
+ * Ironic
+ * Aodh
+ * Ceilometer
+
+ * Swift - highly available, distributed, eventually consistent object/blob store
+ * Sahara - Manage Hadoop Clusters
+ * Ironic - Bare Metal Provisioning
+ * Aodh - Alarms Service
+ * Ceilometer - Track and monitor usage
-What is the role of network namespaces in OpenStack?
+Identify the service/project used for each of the following:
+
+ * Bare Metal Provisioning
+ * Track and monitor usage
+ * Alarms Service
+ * Manage Hadoop Clusters
+ * highly available, distributed, eventually consistent object/blob store
+
+ * Bare Metal Provisioning - Ironic
+ * Track and monitor usage - Ceilometer
+ * Alarms Service - Aodh
+ * Manage Hadoop Clusters
+ * Manage Hadoop Clusters - Sahara
+ * highly available, distributed, eventually consistent object/blob store - Swift
+#### OpenStack Advanced - Keystone
+
+
+Can you describe Keystone service in detail?
+
+ * You can't have OpenStack deployed without Keystone
+ * It Provides identity, policy and token services
+ * The authentication provided is for both users and services
+ * The authorization supported is token-based and user-based.
+ * There is a policy defined based on RBAC stored in a JSON file and each line in that file defines the level of access to apply
+
+
+
+Describe Keystone architecture
+
+ * There is a service API and admin API through which Keystone gets requests
+ * Keystone has four backends:
+ * Token Backend - Temporary Tokens for users and services
+ * Policy Backend - Rules management and authorization
+ * Identity Backend - users and groups (either standalone DB, LDAP, ...)
+ * Catalog Backend - Endpoints
+ * It has pluggable environment where you can integrate with:
+ * LDAP
+ * KVS (Key Value Store)
+ * SQL
+ * PAM
+ * Memcached
+
+
+
+Describe the Keystone authentication process
+
+ * Keystone gets a call/request and checks whether it's from an authorized user, using username, password and authURL
+ * Once confirmed, Keystone provides a token.
+ * A token contains a list of user's projects so there is no to authenticate every time and a token can submitted instead
+
+
+#### OpenStack Advanced - Compute (Nova)
+
+
+What each of the following does?:
+
+ * nova-api
+ * nova-compuate
+ * nova-conductor
+ * nova-cert
+ * nova-consoleauth
+ * nova-scheduler
+
+ * nova-api - responsible for managing requests/calls
+ * nova-compute - responsible for managing instance lifecycle
+ * nova-conductor - Mediates between nova-compute and the database so nova-compute doesn't access it directly
+
+
+
+What types of Nova proxies are you familiar with?
+
+ * Nova-novncproxy - Access through VNC connections
+ * Nova-spicehtml5proxy - Access through SPICE
+ * Nova-xvpvncproxy - Access through a VNC connection
+
+
+#### OpenStack Advanced - Networking (Neutron)
+
+
+Explain BGP dynamic routing
+
+
+
+What is the role of network namespaces in OpenStack?
+
+
+#### OpenStack Advanced - Horizon
+
+
+Can you describe Horizon in detail?
+
+ * Django-based project focusing on providing an OpenStack dashboard and the ability to create additional customized dashboards
+ * You can use it to access the different OpenStack services resources - instances, images, networks, ...
+ * By accessing the dashboard, users can use it to list, create, remove and modify the different resources
+ * It's also highly customizable and you can modify or add to it based on your needs
+
+
+
+What can you tell about Horizon architecture?
+
+ * API is backward compatible
+ * There are three type of dashboards: user, system and settings
+ * It provides core support for all OpenStack core projects such as Neutron, Nova, etc. (out of the box, no need to install extra packages or plugins)
+ * Anyone can extend the dashboards and add new components
+ * Horizon provides templates and core classes from which one can build its own dashboard
+
## Security
@@ -6784,6 +7194,12 @@ TODO: explain what is actually a Cookie
What is DNS load balancing? What its advantages? When would you use it?
+#### Licenses
+
+
+Are you familiar with "Creative Commons"? What do you know about it?
+
+
#### Random
diff --git a/prepare_for_interview.md b/prepare_for_interview.md
index 4db4025..934b271 100644
--- a/prepare_for_interview.md
+++ b/prepare_for_interview.md
@@ -152,4 +152,4 @@ If you do, you should also play the interviewer role :)
### One Last Thing
-[Good luck](https://youtu.be/Xz-UvQYAmbg?t=29) :)
+[Good luck](https://youtu.be/AFUrG1-BAt4?t=59) :)