From 061f1ef6ff1531e21bc98ba0f019771ee21daa68 Mon Sep 17 00:00:00 2001 From: abregman Date: Thu, 10 Dec 2020 08:56:48 +0200 Subject: [PATCH] update --- README.md | 88 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 76 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1b9b9cd..84c87f2 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 **1353** questions +:bar_chart:  There are currently **1359** questions :busts_in_silhouette:  [Join](https://www.facebook.com/groups/538897960007080) our [Facebook group](https://www.facebook.com/groups/538897960007080) for additional exercises, articles and more resources on DevOps @@ -106,16 +106,12 @@ Red Hat:
What are the benefits of DevOps? What it can help us to achieve?
-You should mention some or all of the following: - * Collaboration * Improved delivery * Security * Speed * Scale * Reliability - -Make sure to elaborate :)
@@ -5092,6 +5088,10 @@ SOLID is: Explain big O notation
+
+What is "Duck Typing"?
+
+ ##### Common algorithms
@@ -5916,6 +5916,20 @@ some_dict1.update(some_dict2) ```
+ +
+Convert the string "a.b.c" to the dictionary {'a': {'b': {'c': 1}}}
+ +``` +output = {} +string = "a.b.c" +path = string.split('.') +target = reduce(lambda d, k: d.setdefault(k, {}), path[:-1], output) +target[path[-1]] = 1 +print(output) +``` +
+ ##### Common Algorithms Implementation
@@ -6299,7 +6313,7 @@ What would be the result of is_int(2) and is_int(False)?
-##### Data Structures & Types +#### Python Data Structures & Types
Implement Stack in Python
@@ -6309,7 +6323,7 @@ What would be the result of is_int(2) and is_int(False)? Implement Hash table in Python
-##### Python Testing +#### Python Testing
What is your experience with writing tests in Python?
@@ -6396,8 +6410,62 @@ list(zip(range(5), range(50), range(-2))) ```
-#### Misc +#### Python Descriptors +
+Explain Descriptors
+ +Read about descriptors [here](https://docs.python.org/3/howto/descriptor.html) +
+ +
+What would be the result of running a.num2 assuming the following code + +``` +class B: + def __get__(self, obj, objtype=None): + reuturn 10 + +class A: + num1 = 2 + num2 = Five() +``` +
+10 +
+ +
+What would be the result of running some_car = Car("Red", 4) assuming the following code + +``` +class Print: + + def __get__(self, obj, objtype=None): + value = obj._color + print("Color was set to {}".format(valie)) + return value + + def __set__(self, obj, value): + print("The color of the car is {}".format(value)) + obj._color = value + +class Car: + + color = Print() + + def __ini__(self, color, age): + self.color = color + self.age = age +``` +
+An instance of Car class will be created and the following will be printed: "The color of the car is Red" +
+ +#### Python Misc + +
+How can you spawn multiple processes with Python?
+
Implement simple calculator for two numbers
@@ -6599,10 +6667,6 @@ a = f() Explain the Buffer Protocol
-
-Explain Descriptors
-
-
Do you have experience with web scraping? Can you describe what have you used and for what?