Add ELK and Linux questions

This commit is contained in:
abregman 2020-03-26 04:52:12 +02:00
parent 4d281a8326
commit 464cfc506b

220
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 **918** questions :bar_chart:  There are currently **950** 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 :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
@ -203,6 +203,10 @@ Stateful applications depend on the storage to save state and data, typically da
<summary>Describe the workflow of setting up some type of web server (Apache, IIS, Tomcat, ...)</summary><br><b> <summary>Describe the workflow of setting up some type of web server (Apache, IIS, Tomcat, ...)</summary><br><b>
</b></details> </b></details>
<details>
<summary>How a web server works?</summary><br><b>
</b></details>
<details> <details>
<summary>Explain "Open Source"</summary><br><b> <summary>Explain "Open Source"</summary><br><b>
</b></details> </b></details>
@ -324,6 +328,13 @@ Note: cross-dependency is when you have two or more changes to separate projects
<summary>Have you contributed to an open source project? Tell me about this experience</summary><br><b> <summary>Have you contributed to an open source project? Tell me about this experience</summary><br><b>
</b></details> </b></details>
<details>
<summary>Are you familiar with "The Cathedral and the Bazaar"? Explain each of the models</summary><br><b>
* Cathedral - source code released when software is released
* Bazaar - source code is always available publicly
</b></details>
## Jenkins ## Jenkins
<a name="jenkins-beginner"></a> <a name="jenkins-beginner"></a>
@ -1202,6 +1213,7 @@ An open question. Answer based on your real experience. You can highlight one or
* touch * touch
* man * man
* nslookup or dig * nslookup or dig
* pwd
* df</summary><br><b> * df</summary><br><b>
* ls - list files and directories. You can highlight common flags like -d, -a, -l, ... * ls - list files and directories. You can highlight common flags like -d, -a, -l, ...
@ -1213,9 +1225,20 @@ An open question. Answer based on your real experience. You can highlight one or
* touch - update timestamps but common usage is to create files * touch - update timestamps but common usage is to create files
* man - reference manuals * man - reference manuals
* nslookup or dig - query nameservers * nslookup or dig - query nameservers
* pwd - print working directory
* df - provides info regarding file system disk space usage * df - provides info regarding file system disk space usage
</b></details> </b></details>
<details>
<summary>What each of the following commands does?
* cd ~
* cd
* cd ..
* cd .
* cd -</summary><br><b>
</b></details>
<details> <details>
<summary>Running the command <code>df</code> you get "command not found". What could be wrong and how to fix it?</summary><br><b> <summary>Running the command <code>df</code> you get "command not found". What could be wrong and how to fix it?</summary><br><b>
</b> </b>
@ -1282,7 +1305,11 @@ Using the `chmod` command.
</b></details> </b></details>
<details> <details>
<summary>Explain what is setgid, setuid and sticky bit</summary><br><b> <summary>Explain what is setgid and setuid</summary><br><b>
</b></details>
<details>
<summary>What is the purpose of sticky bit?</summary><br><b>
</b></details> </b></details>
<details> <details>
@ -1713,6 +1740,10 @@ You can use the commands <code>top</code> and <code>free</code>
The ls executable is built for an incompatible architecture. The ls executable is built for an incompatible architecture.
</b></details> </b></details>
<details>
<summary>What is escaping? What escape character is used for escaping?</summary><br><b>
</b></details>
<details> <details>
<summary>How would you split a 50 lines file into 2 files of 25 lines each?</summary><br><b> <summary>How would you split a 50 lines file into 2 files of 25 lines each?</summary><br><b>
@ -1801,16 +1832,22 @@ Technically, yes.
<summary>Which port is used in each of the following protocols?: <summary>Which port is used in each of the following protocols?:
* SSH * SSH
* SMTP
* HTTP * HTTP
* DNS * DNS
* HTTPS</summary><br><b> * HTTPS</summary><br><b>
* SSH - 22 * SSH - 22
* SMTP - 35
* HTTP - 80 * HTTP - 80
* DNS - 53 * DNS - 53
* HTTPS - 443 * HTTPS - 443
</b></details> </b></details>
<details>
<summary>What is telnet and why is it a bad idea to use it in production? (or at all)</summary><br><b>
</b></details>
<details> <details>
<summary>What is the routing table? How do you view it?</summary><br><b> <summary>What is the routing table? How do you view it?</summary><br><b>
</b></details> </b></details>
@ -1868,6 +1905,14 @@ You can specify one or more of the following:
<summary>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?</summary><br><b> <summary>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?</summary><br><b>
</b></details> </b></details>
<details>
<summary>Where repositories are stored? (based on the distribution you are using)</summary><br><b>
</b></details>
<details>
<summary>What is an archive? How do you create one in Linux?</summary><br><b>
</b></details>
##### Applications and Services ##### Applications and Services
<details> <details>
@ -1895,12 +1940,20 @@ Upstart: add Upstart init script at /etc/init/service.conf
<summary>How to print the shared libraries required by a certain program? What is it useful for?</summary><br><b> <summary>How to print the shared libraries required by a certain program? What is it useful for?</summary><br><b>
</b></details> </b></details>
<details>
<summary>What is CUPS?</summary><br><b>
</b></details>
##### Users ##### Users
<details> <details>
<summary>How do you create users? Where user information is stored?</summary><br><b> <summary>How do you create users? Where user information is stored?</summary><br><b>
</b></details> </b></details>
<details>
<summary>How do you change/set the password of a user?</summary><br><b>
</b></details>
<details> <details>
<summary>Do you know how to create a new user without using adduser/useradd command?</summary><br><b> <summary>Do you know how to create a new user without using adduser/useradd command?</summary><br><b>
</b></details> </b></details>
@ -1925,7 +1978,7 @@ Re-install the OS IS NOT the right answer :)
<summary>What is sudo? How do you set it up?</summary><br><b> <summary>What is sudo? How do you set it up?</summary><br><b>
</b></details> </b></details>
#### Random and perhaps useless :) #### Random
<details> <details>
<summary>Give 5 commands which are two letters long</summary><br><b> <summary>Give 5 commands which are two letters long</summary><br><b>
@ -1933,6 +1986,25 @@ Re-install the OS IS NOT the right answer :)
ls, wc, dd, df, du, ps, ip, cp, cd ... ls, wc, dd, df, du, ps, ip, cp, cd ...
</b></details> </b></details>
<details>
<summary>List three ways to print all the files in the current directory</summary><br><b>
* ls
* find .
</b></details>
<details>
<summary>What is '|'? What is it used for?</summary><br><b>
</b></details>
<details>
<summary>You define x=2 in /etc/bashrc and x=6 ~/.bashrc you then login to the system. What would be the value of x?</summary><br><b>
</b></details>
<details>
<summary>Explain "environment variables"</summary><br><b>
</b></details>
<details> <details>
<summary>What a double dash (--) mean?</summary><br><b> <summary>What a double dash (--) mean?</summary><br><b>
@ -1949,6 +2021,14 @@ It's used in commands to mark the end of commands options. One common example is
<summary>What the <code>awk</code> command does? Have you used it? What for?</summary><br><b> <summary>What the <code>awk</code> command does? Have you used it? What for?</summary><br><b>
</b></details> </b></details>
<details>
<summary>What commands you can use for searching files and/or directories?</summary><br><b>
* find
* whereis
* locate
</b></details>
<a name="linux-advanced"></a> <a name="linux-advanced"></a>
#### :star: Advanced #### :star: Advanced
@ -2112,6 +2192,25 @@ 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>
#### Distribution
<details>
<summary>What is a Linux distribution?</summary><br><b>
</b></details>
<details>
<summary>What Linux distributions are you familiar with? List at least four?</summary><br><b>
</b></details>
<details>
<summary>What are the components of a Linux distribution?</summary><br><b>
* Kernel
* Utilities
* Services
* Software/Packages Management
</b></details>
## Operating System ## Operating System
<a name="operating-system-beginner"></a> <a name="operating-system-beginner"></a>
@ -3061,6 +3160,14 @@ Statements are instructions executed by the interpreter like variable assignment
<summary>What is Object Oriented Programming? Why is it important?</summary><br><b> <summary>What is Object Oriented Programming? Why is it important?</summary><br><b>
</b></details> </b></details>
<details>
<summary>What is a compiler?</summary><br><b>
</b></details>
<details>
<summary>What is an interpreter?</summary><br><b>
</b></details>
<details> <details>
<summary>Are you familiar with SOLID design principles?</summary><br><b> <summary>Are you familiar with SOLID design principles?</summary><br><b>
@ -5182,8 +5289,6 @@ as key-value pair, document-oriented, etc.
/bin/bash is the most common shell used as default shell for user login of the linux system. The shells name is an acronym for Bourne-again shell. Bash can execute the vast majority of scripts and thus is widely used because it has more features, is well developed and better syntax. /bin/bash is the most common shell used as default shell for user login of the linux system. The shells name is an acronym for Bourne-again shell. Bash can execute the vast majority of scripts and thus is widely used because it has more features, is well developed and better syntax.
</b></details> </b></details>
<details> <details>
@ -5240,6 +5345,10 @@ If Python, then using pdb is very useful.
Using the keyword <code>read</code> so for example <code>read x</code> will wait for user input and will store it in the variable x. Using the keyword <code>read</code> so for example <code>read x</code> will wait for user input and will store it in the variable x.
</b></details> </b></details>
<details>
<summary>What is globbing?</summary><br><b>
</b></details>
<details> <details>
<summary>Explain conditionals and how do you use them</summary><br><b> <summary>Explain conditionals and how do you use them</summary><br><b>
</b></details> </b></details>
@ -5850,7 +5959,7 @@ You can test by using a stored procedure, so the application must be sanitize th
</b></details> </b></details>
<details> <details>
<summary>Describe how do you secure public repositories</summary> <summary>Describe how do you secure public repositories</summary><br><b>
</b></details> </b></details>
<details> <details>
@ -6039,13 +6148,40 @@ The Elastic Stack consists of:
* Elastic Hadoop * Elastic Hadoop
* APM Server * APM Server
The most used projects are the Elasticserach, Logstash and Kibana. Also known as the ELK stack. Elasticserach, Logstash and Kibana are also known as the ELK stack.
</b></details> </b></details>
<details> <details>
<summary>Describe what happens from the moment the app logged some information until it's displayed to the user in a dashboard when the Elastic stack is used</summary><br><b> <summary>Explain what is Elasticsearch</summary><br><b>
The process may vary based on the chosen architecture: From the official [docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/documents-indices.html):
"Elasticsearch is a distributed document store. Instead of storing information as rows of columnar data, Elasticsearch stores complex data structures that have been serialized as JSON documents"
</b></details>
<details>
<summary>What is Logstash?</summary><br><b>
</b></details>
<details>
<summary>Explain what beats are</summary><br><b>
Beats are lightweight data shippers. These data shippers installed on the client where the data resides.
Examples of beats: Filebeat, Metricbeat, Auditbeat. There are much more.<br>
</b></details>
<details>
<summary>What is Kibana?</summary><br><b>
From the official docs:
"Kibana is an open source analytics and visualization platform designed to work with Elasticsearch. You use Kibana to search, view, and interact with data stored in Elasticsearch indices. You can easily perform advanced data analysis and visualize your data in a variety of charts, tables, and maps."
</b></details>
<details>
<summary>Describe what happens from the moment an app logged some information until it's displayed to the user in a dashboard when the Elastic stack is used</summary><br><b>
The process may vary based on the chosen architecture and the processing you may want to apply to the logs. One possible workflow is:
1. The data logged by the application is picked by filebeat and sent to logstash 1. The data logged by the application is picked by filebeat and sent to logstash
2. Logstash process the log based on the defined filters. Once done, the output is sent to Elasticsearch 2. Logstash process the log based on the defined filters. Once done, the output is sent to Elasticsearch
@ -6057,11 +6193,39 @@ The process may vary based on the chosen architecture:
##### Elasticsearch ##### Elasticsearch
<details> <details>
<summary>Explain what is Elasticsearch</summary><br><b> <summary>What is a data node?</summary><br><b>
From the official [docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/documents-indices.html): This is where data is stored and also where different processing takes place (e.g. when you search for a data).
</b></details>
"Elasticsearch is a distributed document store. Instead of storing information as rows of columnar data, Elasticsearch stores complex data structures that have been serialized as JSON documents" <details>
<summary>What is a master node?</summary><br><b>
Par of a master node responsibilites:
* Track the status of all the nodes in the cluster
* Verify replicas are working and the data is available from every data node.
* No hot nodes (no data node that works much harder than other nodes)
While there can be multiple master nodes in reality only of them is the elected master node.
</b></details>
<details>
<summary>What is an ingest node?</summary><br><b>
A node which responsible for parsing the data. In case you don't use logstash then this node can recieve data from beats and parse it, similarly to how it can be parsed in Logstash.
</b></details>
<details>
<summary>What is Coordinating node?</summary><br><b>
A Coordinating node responsible for routing requests out and in to the cluser (data nodes).
</b></details>
<details>
<summary>How data is stored in elasticsearch?</summary><br><b>
* Data is stored in an index
* The index is spread across the cluster using shards
</b></details> </b></details>
<details> <details>
@ -6075,6 +6239,13 @@ The official docs also offer a great explanation (in general, it's really good d
"An index can be thought of as an optimized collection of documents and each document is a collection of fields, which are the key-value pairs that contain your data" "An index can be thought of as an optimized collection of documents and each document is a collection of fields, which are the key-value pairs that contain your data"
</b></details> </b></details>
<details>
<summary>Explain Shards</summary><br><b>
An index is split into shards and documents are hashed to a particular shard. Each shard may be on a different node in a cluster and each one of the shards is a self contained index.<br>
This allows Elasticsearch to scale to an entire cluster of servers.
</b></details>
<details> <details>
<summary>What is an Inverted Index?</summary><br><b> <summary>What is an Inverted Index?</summary><br><b>
@ -6126,13 +6297,6 @@ From the official docs:
* You can perform language-specific analysis * You can perform language-specific analysis
</b></details> </b></details>
<details>
<summary>Explain Shards</summary><br><b>
An index is split into shards and documents are hashed to a particular shard. Each shard may be on a different node in a cluster and each one of the shards is a self contained index.<br>
This allows Elasticsearch to scale to an entire cluster of servers.
</b></details>
<details> <details>
<summary>Explain Replicas</summary><br><b> <summary>Explain Replicas</summary><br><b>
@ -6231,11 +6395,9 @@ A logstash plugin which modifies information in one format and immerse it in ano
##### Kibana ##### Kibana
<details> <details>
<summary>What is Kibana?</summary><br><b> <summary>What can you find under "Discover" in Kibana?</summary><br><b>
From the official docs: The raw data as it is stored in the index. You can search and filter it.
"Kibana is an open source analytics and visualization platform designed to work with Elasticsearch. You use Kibana to search, view, and interact with data stored in Elasticsearch indices. You can easily perform advanced data analysis and visualize your data in a variety of charts, tables, and maps."
</b></details> </b></details>
<details> <details>
@ -6244,6 +6406,12 @@ From the official docs:
Total number of documents matching the search results. If not query used then simply the total number of documents. Total number of documents matching the search results. If not query used then simply the total number of documents.
</b></details> </b></details>
<details>
<summary>What can you find under "Visualize"?</summary><br><b>
"Visualize" is where you can create visual representations for your data (pie charts, graphs, ...)
</b></details>
<details> <details>
<summary>What visualization types are supported/included in Kibana?</summary><br><b> <summary>What visualization types are supported/included in Kibana?</summary><br><b>
</b></details> </b></details>
@ -6424,6 +6592,12 @@ It's an architecture in which data is and retrieved from a single, non-shared, s
## General ## General
<details>
<summary>What is a server?</summary><br><b>
A computer which serves data from itself to the client.
</b></details>
<details> <details>
<summary>Define or Explain what is an API</summary><br><b> <summary>Define or Explain what is an API</summary><br><b>