Skip to content

Commit fe3cf0d

Browse files
author
abregman
committed
Add a couple of questions and answers
1 parent 874418f commit fe3cf0d

File tree

1 file changed

+102
-10
lines changed

1 file changed

+102
-10
lines changed

README.md

Lines changed: 102 additions & 10 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 **1509** questions
5+
:bar_chart:  There are currently **1518** questions
66

77
:books:  To learn more about DevOps and SRE, check the resources in [devops-resources](https://github.com/bregman-arie/devops-resources) repository
88

@@ -428,6 +428,16 @@ This situation might lead to bugs which hard to identify and reproduce.
428428
Configuration drift can be avoided with desired state configuration (DSC) implementation. Desired state configuration can be a declarative file that defined how a system should be. There are tools to enforce desired state such a terraform or azure dsc. There are incramental or complete strategies.
429429
</b></details>
430430

431+
<details>
432+
<summary>Explain Declarative and Procedural styles. Give examples for each style</summary><br><b>
433+
434+
Declarative - You can write code that specifies the desired end state
435+
Procedural - You describe the steps to get to the desired end state
436+
437+
Declarative Tools - Terraform, Puppet, CloudFormation
438+
Procedural Tools - Ansible, Chef
439+
</b></details>
440+
431441
<details>
432442
<summary>Do you have experience with testing cross-projects changes? (aka cross-dependency)</summary><br><b>
433443

@@ -3951,12 +3961,23 @@ Ansible is:
39513961
* Focus on simpleness and ease-of-use
39523962
</b></details>
39533963

3964+
<details>
3965+
<summary>True or False? Ansible follows the mutable infrastructure paradigm</summary><br><b>
3966+
3967+
True.
3968+
</b></details>
3969+
3970+
<details>
3971+
<summary>True or False? Ansible uses declarative style to describe the expected end state</summary><br><b>
3972+
False. It uses a procedural style.
3973+
</b></details>
3974+
39543975
<details>
39553976
<summary>What kind of automation you wouldn't do with Ansible and why?</summary><br><b>
39563977

3957-
While it's possible to provision resources with Ansible it might not be the best choice for doing so as Ansible doesn't
3958-
save state by default. So a task that creates 5 instances for example, when executed again will create additional 5 instances (unless
3959-
additional check is implemented).
3978+
While it's possible to provision resources with Ansible, some prefer to use tools that follow immutable infrastructure paradigm.
3979+
Ansible doesn't saves state by default. So a task that creates 5 instances for example, when executed again will create additional 5 instances (unless
3980+
additional check is implemented) while other tools will check if 5 instances exist. If only 4 exist, additional instance will be created.
39603981
</b></details>
39613982

39623983
<details>
@@ -4340,6 +4361,17 @@ The benefits of Terraform over the other tools:
43404361
* Ansible and Puppet are more procedural (you mention what to execute in each step) and Terraform is declarative since you describe the overall desired state and not per resource or task. You can give the example of going from 1 to 2 servers in each tool. In Terraform you specify 2, in Ansible and puppet you have to only provision 1 additional server so you need to explicitly make sure you provision only another one server.
43414362
</b></details>
43424363

4364+
<details>
4365+
<summary>True or False? Terraform follows the mutable infrastructure paradigm</summary><br><b>
4366+
4367+
False. Terraform follows immutable infrastructure paradigm.
4368+
</b></details>
4369+
4370+
<details>
4371+
<summary>True or False? Terraform uses declarative style to describe the expected end state</summary><br><b>
4372+
True
4373+
</b></details>
4374+
43434375
<details>
43444376
<summary>Explain what is "Terraform configuration"</summary><br><b>
43454377
A configuration is a root module along with a tree of child modules that are called as dependencies from the root module.
@@ -6010,6 +6042,10 @@ True
60106042
<summary>What is "Duck Typing"?</summary><br><b>
60116043
</b></details>
60126044
6045+
<details>
6046+
<summary>What is "Duck Typing"?</summary><br><b>
6047+
</b></details>
6048+
60136049
##### Common algorithms
60146050
60156051
<details>
@@ -6081,6 +6117,15 @@ The average performance of the above algorithm is O(log n). Best performance can
60816117
<summary>Implement Stack in any language you would like</summary><br><b>
60826118
</b></details>
60836119
6120+
<details>
6121+
<summary>Tell me everything you know about Linked Lists</summary><br><b>
6122+
6123+
* A linked list is a data structure
6124+
* It consists of a collection of nodes. Together these nodes represent a sequence
6125+
* Useful for use cases where you need to insert or remove an element from any position of the linked list
6126+
* Some programming languages don't have linked lists as a built-in data type (like Python for example) but it can be easily implemented
6127+
</b></details>
6128+
60846129
<details>
60856130
<summary>Implement Hash table in any language you would like</summary><br><b>
60866131
</b></details>
@@ -6163,6 +6208,18 @@ The immutable data types are:
61636208
Frozenset
61646209
</b></details>
61656210
6211+
<details>
6212+
<summary>What is a tuple in Python? What is it used for?</summary><br><b>
6213+
6214+
A tuple is a built-in data type in Python. It's used for storing multiple items in a single variable.
6215+
</b></details>
6216+
6217+
<details>
6218+
<summary>List, like a tuple, is also used for storing multiple items. What is then, the difference between a tuple and a list?</summary><br><b>
6219+
6220+
List, as opposed to a tuple, is a mutable data type. It means we can modify it and at items to it.
6221+
</b></details>
6222+
61666223
<details>
61676224
<summary>What is the result of each of the following?
61686225
@@ -7271,6 +7328,45 @@ What would be the result of is_int(2) and is_int(False)?
72717328

72727329
#### Python Data Structures & Types
72737330

7331+
<details>
7332+
<summary>Can you implement linked list in Python?</summary><br><b>
7333+
7334+
The reason we need to implement in the first place, it's because a linked list isn't part of Python standard library.<br>
7335+
To implement a linked list, we have to implement two concepts: The linked list itself and a node which is used by the linked list.
7336+
7337+
Let's start with a node. A node has some value and it also points to the next node
7338+
7339+
```
7340+
class Node(object):
7341+
def __init__(self, data):
7342+
self.data = data
7343+
self.next = None
7344+
```
7345+
7346+
Now the linked list. An empty linked list has nothing but an empty head.
7347+
7348+
```
7349+
class LinkedList(object):
7350+
def __init__(self):
7351+
self.head = None
7352+
```
7353+
7354+
Now we can start using the linked list
7355+
7356+
```
7357+
ll = Linkedlist()
7358+
ll.head = Node(1)
7359+
ll.head.next = Node(2)
7360+
ll.head.next.next = Node(3)
7361+
```
7362+
7363+
What we have is:
7364+
7365+
---- ----- ----
7366+
| 1 | -> | 2 | -> | 3 |
7367+
---- ----- -----
7368+
</b></details>
7369+
72747370
<details>
72757371
<summary>Implement Stack in Python</summary><br><b>
72767372
</b></details>
@@ -7627,10 +7723,6 @@ a = f()
76277723
<summary>Do you have experience with web scraping? Can you describe what have you used and for what?</summary><br><b>
76287724
</b></details>
76297725

7630-
<details>
7631-
<summary>Can you implement Linked List in Python?</summary><br><b>
7632-
</b></details>
7633-
76347726
<details>
76357727
<summary>Can you implement Linux's <code>tail</code> command in Python? Bonus: implement <code>head</code> as well</summary><br><b>
76367728
</b></details>
@@ -10993,9 +11085,9 @@ Bonus: extract the last word of each line
1099311085
<summary>Replace 'red' with 'green'</summary><br><b>
1099411086
</b></details>
1099511087

10996-
## System Design
11088+
## System Designotebookn
1099711089

10998-
This section contains only questions on System Design subject. The exercises can be found in [system-design-exercises repository](https://github.com/bregman-arie/system-design-exercises).
11090+
This section contains only questions on System Design subject. The exercises can be found in [system-design-notebook repository](https://github.com/bregman-arie/system-design-notebook).
1099911091

1100011092
#### Architecture
1100111093

0 commit comments

Comments
 (0)