From 44a036a9259b171f2f4578539441a3ba7fc0c705 Mon Sep 17 00:00:00 2001
From: Tanuj Dhiman <56601466+tanujdhiman@users.noreply.github.com>
Date: Sun, 27 Jun 2021 23:01:11 +0530
Subject: [PATCH 1/4] Update binary_search.py (#129)
---
coding/python/binary_search.py | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/coding/python/binary_search.py b/coding/python/binary_search.py
index 2fd753c..cb4fefb 100644
--- a/coding/python/binary_search.py
+++ b/coding/python/binary_search.py
@@ -2,11 +2,10 @@
import random
-rand_num_li = sorted([random.randint(1, 50) for _ in range(10)])
-target = random.randint(1, 50)
-
-
def binary_search(arr, lb, ub, target):
+ """
+ A Binary Search Example which has O(log n) time complexity.
+ """
if lb <= ub:
mid = ub + lb // 2
if arr[mid] == target:
@@ -18,7 +17,9 @@ def binary_search(arr, lb, ub, target):
else:
return -1
-
-print("List: {}\nTarget: {}\nIndex: {}".format(
- rand_num_li, target,
- binary_search(rand_num_li, 0, len(rand_num_li) - 1, target)))
+if __name__ == '__main__':
+ rand_num_li = sorted([random.randint(1, 50) for _ in range(10)])
+ target = random.randint(1, 50)
+ print("List: {}\nTarget: {}\nIndex: {}".format(
+ rand_num_li, target,
+ binary_search(rand_num_li, 0, len(rand_num_li) - 1, target)))
From 395a2ce634544627c2a3ecbf9ff67c4e0756a197 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Mati=C4=87?=
<48199696+stefan-matic@users.noreply.github.com>
Date: Wed, 30 Jun 2021 05:12:06 +0200
Subject: [PATCH 2/4] Updating some answers (#131)
---
README.md | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/README.md b/README.md
index 432d00d..831e122 100644
--- a/README.md
+++ b/README.md
@@ -3497,10 +3497,16 @@ This is a great article on the topic: https://www.computerhope.com/jargon/f/file
How to list all the interfaces?
+
+```
+ip link show
+```
What is the loopback (lo) interface?
+
+The loopback interface is a special, virtual network interface that your computer uses to communicate with itself. It is used mainly for diagnostics and troubleshooting, and to connect to servers running on the local machine.
@@ -3568,6 +3574,9 @@ Technically, yes.
What is telnet and why is it a bad idea to use it in production? (or at all)
+
+Telnet is a type of client-server protocol that can be used to open a command line on a remote computer, typically a server.
+By default, all the data sent and received via telnet is transmitted in clear/plain text, therefore it should not be used as it does not encrypt any data between the client and the server.
From 9a3e878480117fc542341f2e9d7c11864c366dfd Mon Sep 17 00:00:00 2001
From: Bill <69961188+billxu1@users.noreply.github.com>
Date: Wed, 30 Jun 2021 22:19:59 +1000
Subject: [PATCH 3/4] Added < and > to list of quesitons. (#132)
* Added two questions
Added in > and < for Linux, as well as yes command (yes XYZ repeats XYZ in the console, useful for repetitive input)
---
README.md | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/README.md b/README.md
index 831e122..42c16dc 100644
--- a/README.md
+++ b/README.md
@@ -2513,6 +2513,13 @@ These are files directly not displayed after performing a standard ls direct lis
`ls -a`
+
+What do > and < do in terms of input and output for programs?
+They take in input (<) and output for a given file (>) using stdin and stdout.
+
+`myProgram < input.txt > executionOutput.txt`
+
+
Explain what each of the following commands does and give an example on how to use it:
From 1439d5983ecd81a1efd521b573d6ec542b31f3c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Mati=C4=87?=
<48199696+stefan-matic@users.noreply.github.com>
Date: Thu, 1 Jul 2021 19:23:50 +0200
Subject: [PATCH 4/4] Add more answers (#135)
* Add more answers
* Answer more questions
* Answered some more
---
README.md | 46 ++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 42 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 42c16dc..4c9e352 100644
--- a/README.md
+++ b/README.md
@@ -661,6 +661,8 @@ The pipelines will have multiple stages:
How to secure Jenkins?
+
+ [Jenkins documentation](https://www.jenkins.io/doc/book/security/securing-jenkins/) provides some basic intro for securing your Jenkins server.
@@ -710,6 +712,16 @@ You can describe the UI way to add new nodes but better to explain how to do in
What is Cloud Computing? What is a Cloud Provider?
+
+Cloud computing refers to the delivery of on-demand computing services
+over the internet on a pay-as-you-go basis.
+
+In simple words, Cloud computing is a service that lets you use any computing
+service such as a server, storage, networking, databases, and intelligence,
+right through your browser without owning anything. You can do anything you
+can think of unless it doesn’t require you to stay close to your hardware.
+
+Cloud service providers are companies that establish public clouds, manage private clouds, or offer on-demand cloud computing components (also known as cloud computing services) like Infrastructure-as-a-Service (IaaS), Platform-as-a-Service (PaaS), and Software-as-a-Service(SaaS). Cloud services can reduce business process costs when compared to on-premise IT.
@@ -1537,6 +1549,8 @@ False. Only one internet gateway can be attached to a single VPC.
What is an Elastic IP address?
+An Elastic IP address is a reserved public IP address that you can assign to any EC2 instance in a particular region, until you choose to release it.
+When you associate an Elastic IP address with an EC2 instance, it replaces the default public IP address. If an external hostname was allocated to the instance from your launch settings, it will also replace this hostname; otherwise, it will create one for the instance. The Elastic IP address remains in place through events that normally cause the address to change, such as stopping or restarting the instance.
@@ -2093,6 +2107,9 @@ Packets that are sent on the ethernet are always coming from a MAC address and s
When is this MAC address used?: ff:ff:ff:ff:ff:ff
+
+
+When a device sends a packet to the broadcast MAC address (FF:FF:FF:FF:FF:FF), it is delivered to all stations on the local network. It needs to be used in order for all devices to receive your packet at the datalink layer.
@@ -2338,7 +2355,10 @@ Read more [here](https://linuxjourney.com/lesson/dhcp-overview)
-What is NAT? How does it works?
+What is NAT? How does it work?
+
+NAT stands for network address translation. It’s a way to map multiple local private addresses to a public one before transferring the information. Organizations that want multiple devices to employ a single IP address use NAT, as do most home routers.
+For example, your computer's private IP could be 192.168.1.100, but your router maps the traffic to it's public IP (e.g. 1.1.1.1). Any device on the internet would see the traffic coming from your public IP (1.1.1.1) instead of your private IP (192.168.1.100).
@@ -2622,6 +2642,8 @@ Using a pipe in Linux, allows you to send the output of one to another (also cal
What is special about the /tmp directory when compared to other directories?
+
+`/tmp` folder get cleaned automatically, usually upon reboot.
@@ -4269,7 +4291,9 @@ Cache: Cache is usually used when processes reading and writing to the disk to m
## Virtualization
-Explain what is Virtualization
+What is Virtualization?
+
+Virtualization uses software to create an abstraction layer over computer hardware that allows the hardware elements of a single computer—processors, memory, storage and more - to be divided into multiple virtual computers, commonly called virtual machines (VMs).
@@ -4873,10 +4897,14 @@ Output variables are named values that are sourced from the attributes of a modu
Explain Modules
+
+A Terraform module is a set of Terraform configuration files in a single directory. Modules are small, reusable Terraform configurations that let you manage a group of related resources as if they were a single resource. Even a simple configuration consisting of a single directory with one or more .tf files is a module. When you run Terraform commands directly from such a directory, it is considered the root module. So in this sense, every Terraform configuration is part of a module.
What is the Terraform Registry?
+
+The Terraform Registry provides a centralized location for official and community-managed providers and modules.
@@ -4917,14 +4945,15 @@ Output variables are named values that are sourced from the attributes of a modu
What is a Container? What is it used for?
+
+Containers are a form of operating system virtualization. A single container might be used to run anything from a small microservice or software process to a larger application. Inside a container are all the necessary executables, binary code, libraries, and configuration files, making them easy to ship and run with same expected results on different machines.
How are containers different from virtual machines (VMs)?
The primary difference between containers and VMs is that containers allow you to virtualize
-multiple workloads on the operating system while in the case of VMs the hardware is being virtualized to
-run multiple machines each with its own OS.
+multiple workloads on the operating system while in the case of VMs the hardware is being virtualized to run multiple machines each with its own OS.
You can also think about it as containers are for OS-level virtualization while VMs are for hardware virtualization.
* Containers don't require an entire guest operating system as VMs. Containers share the system's kernel as opposed to VMs
@@ -11817,14 +11846,20 @@ Additional exercises can be found in [system-design-notebook repository](https:/
What is a CPU?
+
+A central processing unit (CPU) performs basic arithmetic, logic, controlling, and input/output (I/O) operations specified by the instructions in the program. This contrasts with external components such as main memory and I/O circuitry, and specialized processors such as graphics processing units (GPUs).
What is RAM?
+
+RAM (Random Access Memory) is the hardware in a computing device where the operating system (OS), application programs and data in current use are kept so they can be quickly reached by the device's processor. RAM is the main memory in a computer. It is much faster to read from and write to than other kinds of storage, such as a hard disk drive (HDD), solid-state drive (SSD) or optical drive.
What is an embedded system?
+
+An embedded system is a computer system - a combination of a computer processor, computer memory, and input/output peripheral devices—that has a dedicated function within a larger mechanical or electronic system. It is embedded as part of a complete device often including electrical or electronic hardware and mechanical parts.
@@ -11852,6 +11887,9 @@ As defined by Doug Laney:
What is DataOps? How is it related to DevOps?
+
+ DataOps seeks to reduce the end-to-end cycle time of data analytics, from the origin of ideas to the literal creation of charts, graphs and models that create value.
+ DataOps combines Agile development, DevOps and statistical process controls and applies them to data analytics.