Skip to content

Commit 08b2380

Browse files
author
abregman
committed
900 questions milestone
1 parent 4145ae6 commit 08b2380

File tree

5 files changed

+145
-30
lines changed

5 files changed

+145
-30
lines changed

README.md

Lines changed: 142 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
:information_source:  This repo contains questions and exercises on various technical topics, sometimes related to DevOps and SRE :)
44

5-
:bar_chart:  There are currently **881** questions
5+
:bar_chart:  There are currently **900** questions
66

77
: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
88

@@ -1056,6 +1056,10 @@ Systems keep an ARP look-up table where they store information about what IP add
10561056
<summary>What is MTU?</summary><br><b>
10571057
</b></details>
10581058

1059+
<details>
1060+
<summary>What happens if you send a packet that is bigger than the MTU?</summary><br><b>
1061+
</b></details>
1062+
10591063
<details>
10601064
<summary>True or False?. Ping is using UDP because it doesn't care about reliable connection</summary><br><b>
10611065
</b></details>
@@ -1072,14 +1076,6 @@ Systems keep an ARP look-up table where they store information about what IP add
10721076
<summary>What is NAT? How it works?</summary><br><b>
10731077
</b></details>
10741078

1075-
<details>
1076-
<summary>What is latency?</summary><br><b>
1077-
</b></details>
1078-
1079-
<details>
1080-
<summary>What is bandwidth?</summary><br><b>
1081-
</b></details>
1082-
10831079
<details>
10841080
<summary>Which factors affect network performances</summary><br><b>
10851081
</b></details>
@@ -1953,6 +1949,10 @@ If wait is not used by a parent process then a child process might become a zomb
19531949
Executes a program. The program is passed as a filename (or path) and must be a binary executable or a script.
19541950
</b></details>
19551951

1952+
<details>
1953+
<summary>What is the return value of malloc?</summary><br><b>
1954+
</b></details>
1955+
19561956
<details>
19571957
<summary>What happens when you execute <code>ls -l</code>?</summary><br><b>
19581958

@@ -3238,6 +3238,17 @@ It evaluates to True.<br>
32383238
The reason is that the two created empty list are different objects. `x is y` only evaluates to true when x and y are the same object.
32393239
</b></details>
32403240

3241+
<details>
3242+
<summary>Improve the following code:
3243+
3244+
```
3245+
char = input("Insert a character: ")
3246+
if char == "a" or char == "y" or char == "o" or char == "e" or char =="u" or char == "i":
3247+
print("It's a vowel!")
3248+
```
3249+
</summary><br><b>
3250+
</b></details>
3251+
32413252
<details>
32423253
<summary>Explain inheritance and how to use it in Python</summary><br><b>
32433254

@@ -3517,6 +3528,12 @@ print("{0:.3f}".format(sum(li)/len(li)))
35173528

35183529
#### Python Lists
35193530

3531+
<details>
3532+
<summary>How to add the items of [1, 2, 3] to the list [4, 5, 6]?</summary><br><b>
3533+
x = [4, 5, 6]
3534+
x.extend([1, 2, 3])
3535+
</b></details>
3536+
35203537
<details>
35213538
<summary>How do you get the maximum and minimum values from a list? How to get the last item from a list?</summary><br><b>
35223539

@@ -5956,27 +5973,25 @@ CPDoS or Cache Poisoned Denial of Service. It poisons the CDN cache. By manipula
59565973
The Elastic Stack consists of:
59575974

59585975
* Elasticsearch
5959-
* Elastic Hadoop
59605976
* Kibana
59615977
* Logstash
59625978
* Beats
5979+
* Elastic Hadoop
59635980
* APM Server
59645981

59655982
The most used projects are the Elasticserach, Logstash and Kibana. Also known as the ELK stack.
59665983
</b></details>
59675984

59685985
<details>
5969-
<summary>Describe what happens from the moment the app logged some information until it's displayed to the user in the dashboard when the Elastic stack is used</summary><br><b>
5986+
<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>
59705987

5971-
1. The data logged by the application is sent to Elasticsearch
5972-
2. Elasticsearch stores the document it got and the document is indexed for quick future access
5973-
3. Logstash processes the data
5974-
4. The user creates visualizations which uses the index in elasticsearch and more specifically the data there (this is done in Kibana).
5975-
5. The user creates a dashboard which composed out of the visualization created earlier
5976-
</b></details>
5988+
The process may vary based on the chosen architecture:
59775989

5978-
<details>
5979-
<summary>You are running an app which outputs several log files (without timestamps). What do you do in order to process the information they include and display it in Kibana? you can ask for additional information if required for answering this question</summary><br><b>
5990+
1. The data logged by the application is picked by filebeat and sent to logstash
5991+
2. Logstash process the log based on the defined filters. Once done, the output is sent to Elasticsearch
5992+
2. Elasticsearch stores the document it got and the document is indexed for quick future access
5993+
4. The user creates visualizations in Kibana which based on the indexed data
5994+
5. The user creates a dashboard which composed out of the visualization created in the previous step
59805995
</b></details>
59815996

59825997
##### Elasticsearch
@@ -6019,7 +6034,6 @@ As in NoSQL a Document is a JSON object which holds data on a unit in your app.
60196034
<summary>True or False? Elasticsearch indexes all data in every field and each indexed field has the same data structure for unified and quick query ability</summary><br><b>
60206035

60216036
False.
6022-
60236037
From the official docs:
60246038

60256039
"Each indexed field has a dedicated, optimized data structure. For example, text fields are stored in inverted indices, and numeric and geo fields are stored in BKD trees."
@@ -6057,8 +6071,6 @@ This allows Elasticsearch to scale to an entire cluster of servers.
60576071

60586072
In a network/cloud environment where failures can be expected any time, it is very useful and highly recommended to have a failover mechanism in case a shard/node somehow goes offline or disappears for whatever reason.
60596073
To this end, Elasticsearch allows you to make one or more copies of your index’s shards into what are called replica shards, or replicas for short.
6060-
6061-
60626074
</b></details>
60636075

60646076
<details>
@@ -6067,6 +6079,13 @@ To this end, Elasticsearch allows you to make one or more copies of your index
60676079
Term Frequency is how often a term appears in a given document and Document Frequency is how often a term appears in all documents. They both are used for determining the relevance of a term by calculating Term Frequency / Document Frequency.
60686080
</b></details>
60696081

6082+
<details>
6083+
<summary>You check "Current Phase" under "Index lifecycle management" and you see it's set to "hot". What does it mean?</summary><br><b>
6084+
6085+
"The index is actively being written to".
6086+
More about the phases [here](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/ilm-policy-definition.html)
6087+
</b></details>
6088+
60706089
##### Query DSL
60716090

60726091
<details>
@@ -6098,7 +6117,29 @@ From the official docs:
60986117
</b></details>
60996118

61006119
<details>
6101-
<summary>What are Logstash Codecs?</summary><br><b>
6120+
<summary>What is grok?</summary><br><b>
6121+
6122+
A logstash plugin which modifies information in one format and immerse it in another.
6123+
</b></details>
6124+
6125+
<details>
6126+
<summary>How grok works?</summary><br><b>
6127+
</b></details>
6128+
6129+
<details>
6130+
<summary>What grok patterns are you familiar with?</summary><br><b>
6131+
</b></details>
6132+
6133+
<details>
6134+
<summary>What is `_grokparsefailure?`</summary><br><b>
6135+
</b></details>
6136+
6137+
<details>
6138+
<summary>How do you test or debug grok patterns?</summary><br><b>
6139+
</b></details>
6140+
6141+
<details>
6142+
<summary>What are Logstash Codecs? What codecs are there?</summary><br><b>
61026143
</b></details>
61036144

61046145
##### Kibana
@@ -6135,6 +6176,10 @@ Total number of documents matching the search results. If not query used then si
61356176
<summary>What is Filebeat?</summary><br><b>
61366177
</b></details>
61376178

6179+
<details>
6180+
<summary>If one is using ELK, is it a must to also use filebeat? In what scenarios it's useful to use filebeat?</summary><br><b>
6181+
</b></details>
6182+
61386183
<details>
61396184
<summary>What are filebeat modules?</summary><br><b>
61406185
</b></details>
@@ -6236,6 +6281,17 @@ MX (Mail Exchange) Specifies a mail exchange server for the domain, which allows
62366281
According to Martin Kleppmann:
62376282

62386283
"Many processes running on many machines...only message-passing via an unreliable network with variable delays, and the system may suffer from partial failures, unreliable clocks, and process pauses."
6284+
6285+
Another definition: "Systems that are physically separated, but logically connected"
6286+
</b></details>
6287+
6288+
<details>
6289+
<summary>What can cause a system to fail?</summary><br><b>
6290+
6291+
* Network
6292+
* CPU
6293+
* Memory
6294+
* Disk
62396295
</b></details>
62406296

62416297
<details>
@@ -6248,12 +6304,37 @@ According to the CAP theorem, it's not possible for a distributed data store to
62486304
* Partition tolerance: Even if some the data is lost/dropped, the system keeps running
62496305
</b></details>
62506306

6307+
<details>
6308+
<summary>What are the problems with the following design? How to improve it?<br>
6309+
<img src="images/distributed/distributed_design_standby.png" width="500x;" height="350px;"/>
6310+
</summary><br><b>
6311+
1. The transition can take time. In other words, noticeable downtime.
6312+
2. Standby server is a waste of resources - if first application server is running then the standby does nothing
6313+
</b></details>
6314+
6315+
<details>
6316+
<summary>What are the problems with the following design? How to improve it?<br>
6317+
<img src="images/distributed/distributed_design_lb.png" width="700x;" height="350px;"/>
6318+
</summary><br><b>
6319+
Issues:
6320+
If load balancer dies , we lose the ability to communicate with the application.
6321+
6322+
Ways to improve:
6323+
* Add another load balancer
6324+
* Use DNS A record for both load balancers
6325+
* Use message queue
6326+
</b></details>
6327+
62516328
<details>
62526329
<summary>What is "Shared-Nothing" architecture?</summary><br><b>
62536330

62546331
It's an architecture in which data is and retrieved from a single, non-shared, source usually exclusively connected to one node as opposed to architectures where the request can get to one of many nodes and the data will be retrieved from one shared location (storage, memory, ...).
62556332
</b></details>
62566333

6334+
<details>
6335+
<summary>Explain the Sidecar Pattern</summary><br><b>
6336+
</b></details>
6337+
62576338
## General
62586339

62596340
<details>
@@ -6264,6 +6345,36 @@ I like this definition from [here](https://blog.christianposta.com/microservices
62646345
"An explicitly and purposefully defined interface designed to be invoked over a network that enables software developers to get programmatic access to data and functionality within an organization in a controlled and comfortable way."
62656346
</b></details>
62666347

6348+
<details>
6349+
<summary>What is latency?</summary><br><b>
6350+
</b></details>
6351+
6352+
<details>
6353+
<summary>What is bandwidth?</summary><br><b>
6354+
</b></details>
6355+
6356+
<details>
6357+
<summary>What is throughput?</summary><br><b>
6358+
</b></details>
6359+
6360+
<details>
6361+
<summary>When performing a search query, what is more important, latency or throughput? And how to assure that what managing global infrastructure?</summary><br><b>
6362+
6363+
Latency. To have a good latency, a search query should be forwarded to the closest datacenter.
6364+
</b></details>
6365+
6366+
<details>
6367+
<summary>When uploading a video, what is more important, latency or throughput? And how to assure that?</summary><br><b>
6368+
6369+
Throughput. To have a good throughput, the upload stream should be routed to an underutilized link.
6370+
</b></details>
6371+
6372+
<details>
6373+
<summary>What other considerations (except latency and throughput) are there when forwarding requests?</summary><br><b>
6374+
6375+
* Keep caches updated (which means the request could be forwarded not to the closest datacenter)
6376+
</b></details>
6377+
62676378
#### Jira
62686379

62696380
<details>
@@ -6380,6 +6491,10 @@ TODO: explain what is actually a Cookie
63806491
<summary>What is an Application Load Balancer?</summary><br><b>
63816492
</b></details>
63826493

6494+
<details>
6495+
<summary>What is DNS load balancing? What its advantages? When would you use it?</summary><br><b>
6496+
</b></details>
6497+
63836498
#### Random
63846499

63856500
<details>
@@ -6583,11 +6698,11 @@ Not only this will tell you what is expected from you, it will also provide big
65836698
## Testing
65846699

65856700
<details>
6586-
<summary>What types of tests would you run for web application?</summary><br><b>
6701+
<summary>What are unit tests?</summary><br><b>
65876702
</b></details>
65886703

65896704
<details>
6590-
<summary>What are unit tests?</summary><br><b>
6705+
<summary>What types of tests would you run to test a web application?</summary><br><b>
65916706
</b></details>
65926707

65936708
<details>
@@ -6741,13 +6856,13 @@ Horizontal Scaling is the process of adding more resources that will be able han
67416856

67426857
<details>
67436858
<summary>How would you update each of the services in the following drawing without having app (foo.com) downtime?<br>
6744-
<img src="images/design/cdn-no-downtime.png" width="200x;" height="300px;"/>
6859+
<img src="images/design/cdn-no-downtime.png" width="300x;" height="400px;"/>
67456860
</summary><br><b>
67466861
</b></details>
67476862

67486863
<details>
67496864
<summary>What is the problem with the following architecture and how would you fix it?<br>
6750-
<img src="images/design/producers_consumers_issue.png" width="300x;" height="200px;"/>
6865+
<img src="images/design/producers_consumers_issue.png" width="400x;" height="300px;"/>
67516866
</summary><br><b>
67526867

67536868
The load on the producers or consumers may be high which will then cause them to hang or crash.<br>

common-qa.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ It is also used sometimes (from what I've been told) to prepare for interviews b
99

1010
### My goal is to prepare for a DevOps interview. How to do that?
1111

12-
I've added a couple of suggestions here [here](prepare_for_interview.md)
13-
Feel free to contribute any ideas and insights
12+
I've added a couple of suggestions [here](prepare_for_interview.md)<br>
13+
Feel free to contribute any ideas and insights you have.
1414

1515
### How do I become a better DevOps Engineer?
1616

exercises/write_dockerfile_run_container.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Your task is as follows:
66
* Use centos or ubuntu as the base image
77
* Install apache web server
88
* Deploy any web application you want
9-
* Add https support (using HAProxy as reverse-proxy)))
9+
* Add https support (using HAProxy as reverse-proxy)
1010
2. Once you wrote the Dockerfile and created an image, run the container and test the application. Describe how did you test it and provide output
1111
3. Describe one or more weakness of your Dockerfile. Is it ready to be used in production?
21.9 KB
Loading
Loading

0 commit comments

Comments
 (0)