2
2
3
3
:information_source :   ; This repository contains questions on various DevOps and SRE related topics
4
4
5
- :bar_chart :   ; There are currently ** 781 ** questions
5
+ :bar_chart :   ; There are currently ** 786 ** questions
6
6
7
7
:books :   ; To learn more about DevOps check the resources in [ DevOpsBit.com] ( https://devopsbit.com )
8
8
@@ -2905,7 +2905,21 @@ There is a more advanced python feature called MetaClasses that aid the programm
2905
2905
</b ></details >
2906
2906
2907
2907
<details >
2908
- <summary > What is an error? What is an exception? What types of exceptions are you familiar with?</summary ><br ><b >
2908
+ <summary >Explain and demonstrate class attributes & instance attributes</summary ><br ><b >
2909
+
2910
+ In the following block of code ` x ` is a class attribute while ` self.y ` is a instance attribute
2911
+
2912
+ ```
2913
+ class MyClass(object):
2914
+ x = 1
2915
+
2916
+ def __init__(self, y):
2917
+ self.y = y
2918
+ ```
2919
+ </b ></details >
2920
+
2921
+ <details >
2922
+ <summary >What is an error? What is an exception? What types of exceptions are you familiar with?</summary ><br ><b >
2909
2923
2910
2924
```
2911
2925
# Note that you generally don't need to know the compiling process but knowing where everything comes from
@@ -3054,7 +3068,7 @@ some_list[:3]
3054
3068
</b ></details >
3055
3069
3056
3070
<details >
3057
- <summary >How to sort list be the length of items?</summary ><br ><b >
3071
+ <summary >How to sort list by the length of items?</summary ><br ><b >
3058
3072
3059
3073
```
3060
3074
sorted_li = sorted(li, key=len)
@@ -3381,11 +3395,14 @@ colums = list(zip(*(rows)))
3381
3395
3382
3396
<details >
3383
3397
<summary >What is the result of each of the following?
3398
+
3384
3399
```
3385
3400
>> ', '.join(["One", "Two", "Three"])
3386
3401
>> " ".join("welladsadgadoneadsadga".split("adsadga")[:2])
3387
3402
>> "".join(["c", "t", "o", "a", "o", "q", "l"])[0::2]
3403
+ ```
3388
3404
</summary ><br ><b >
3405
+
3389
3406
```
3390
3407
>>> 'One, Two, Three'
3391
3408
>>> 'well done'
@@ -3466,6 +3483,7 @@ the_list.sort(key=lambda x: x[1])
3466
3483
3467
3484
<details >
3468
3485
<summary >Explain the following:
3486
+
3469
3487
* zip()
3470
3488
* map()
3471
3489
* filter()</summary ><br ><b >
@@ -5675,6 +5693,24 @@ Not only this will tell you what is expected from you, it will also provide big
5675
5693
5676
5694
## Design
5677
5695
5696
+ #### Architecture
5697
+
5698
+ <details >
5699
+ <summary >Explain "3-Tier Architecture" (including pros and cons)</summary ><br ><b >
5700
+ </b ></details >
5701
+
5702
+ <details >
5703
+ <summary >What are the drawbacks of monolithic architecture?</summary ><br ><b >
5704
+
5705
+ * Not suitable for frequent code changes and the ability to deploy new features
5706
+ * Not designed for today's infrastructure (like public clouds)
5707
+ * Scaling a team to work monolithic architecture is more challenging
5708
+ </b ></details >
5709
+
5710
+ <details >
5711
+ <summary >What are the advantages of micro-services architecture over a monolithic architecture?</summary ><br ><b >
5712
+ </b ></details >
5713
+
5678
5714
#### Scalability
5679
5715
5680
5716
<details >
@@ -5695,6 +5731,17 @@ Horizontal Scaling is the process of adding more resources that will be able han
5695
5731
</summary ><br ><b >
5696
5732
</b ></details >
5697
5733
5734
+ <details >
5735
+ <summary >What is the problem with the following architecture and how would you fix it?<br >
5736
+ <img src =" images/design/producers_consumers_issue.png " width =" 300x; " height =" 200px; " />
5737
+ </summary ><br ><b >
5738
+
5739
+ The load on the producers or consumers may be high which will then cause them to hang or crash.<br >
5740
+ Instead of working in "push mode", the consumers can pull tasks only when they are ready to handle them. It can be fixed by using a streaming platform like Kafka, Kinesis, etc. This platform will make sure to handle the high load/traffic and pass tasks/messages to consumers only when the ready to get them.
5741
+
5742
+ <img src =" images/design/producers_consumers_fix.png " width =" 300x; " height =" 200px; " />
5743
+ </b ></details >
5744
+
5698
5745
<details >
5699
5746
<summary >Users report that there is huge spike in process time when adding little bit more data to process as an input. What might be the problem?<br >
5700
5747
<img src =" images/design/input-process-output.png " width =" 300x; " height =" 200px; " />
0 commit comments