You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,12 @@ Stick to the following format:
12
12
13
13
* If you added several questions and you would like to know how many questions are there you can use the script "count_questions.sh" in scripts directory.
14
14
15
-
16
15
## What to avoid
17
16
18
17
* Avoid adding installation questions. Those are the worst type of questions...
19
18
* Don't copy questions and answers from other sources. They probably worked hard for adding them.
20
19
* If you add new images, make sure they are free and can be used.
20
+
21
+
## Before submitting the pull request
22
+
23
+
You can test your changes locally with the script `run_ci.sh` in scripts directory.
:information_source: This repository contains questions on various DevOps and SRE related topics
4
4
5
-
:bar_chart: There are currently **714** questions
5
+
:bar_chart: There are currently **720** questions
6
6
7
7
:books: To learn more about DevOps check the resources in [DevOpsBit.com](https://devopsbit.com)
8
8
@@ -1678,14 +1678,20 @@ Re-install the OS IS NOT the right answer :)
1678
1678
<summary>What is sudo? How do you set it up?</summary><br><b>
1679
1679
</b></details>
1680
1680
1681
-
#### Random and Strange :)
1681
+
#### Random and perhaps useless :)
1682
1682
1683
1683
<details>
1684
1684
<summary>Give 5 commands which are two letters long</summary><br><b>
1685
1685
1686
1686
ls, wc, dd, df, du, ps, ip, cp, cd ...
1687
1687
</b></details>
1688
1688
1689
+
<details>
1690
+
<summary>What a double dash (--) mean?</summary><br><b>
1691
+
1692
+
It's used in commands to mark the end of commands options. One common example is when used with git to discard local changes: `git checkout -- some_file`
1693
+
</b></details>
1694
+
1689
1695
#### Commands
1690
1696
1691
1697
<details>
@@ -1699,10 +1705,45 @@ ls, wc, dd, df, du, ps, ip, cp, cd ...
1699
1705
<aname="linux-advanced"></a>
1700
1706
#### :star: Advanced
1701
1707
1708
+
#### System Calls
1709
+
1710
+
<details>
1711
+
<summary>Explain the fork system call</summary><br><b>
1712
+
1713
+
fork() is used for creating a new process. It does so by cloning the calling process but the child process has its own PID and any memory locks, I/O operations and semaphores are not inherited.
1714
+
</b></details>
1715
+
1716
+
<details>
1717
+
<summary>Explain the exec system call</summary><br><b>
1718
+
</b></details>
1719
+
1720
+
<details>
1721
+
<summary>What are the differences between exec() and fork()?</summary><br><b>
1722
+
</b></details>
1723
+
1724
+
<details>
1725
+
<summary>Why do we need the wait system call?</summary><br><b>
1726
+
1727
+
wait() is used by a parent process to wait for the child process to finish execution.
1728
+
If wait is not used by a parent process then a child process might become a zombie process.
1729
+
</b></details>
1730
+
1702
1731
<details>
1703
1732
<summary>What happens when you execute <code>ls</code>?. Provide a detailed answer</summary><br><b>
1704
1733
</b></details>
1705
1734
1735
+
#### Linux Filesystem & Files
1736
+
1737
+
<details>
1738
+
<summary>How to create a file of a certain size?</summary><br><b>
<summary>Explain the fork system call</summary><br><b>
1774
-
1775
-
fork() is used for creating a new process.
1776
-
</b></details>
1777
-
1778
-
<details>
1779
-
<summary>Explain the fork system call</summary><br><b>
1780
-
</b></details>
1781
-
1782
-
<details>
1783
-
<summary>What are the differences between exec() and fork()?</summary><br><b>
1784
-
</b></details>
1785
-
1786
-
<details>
1787
-
<summary>Why do we need the wait system call?</summary><br><b>
1788
-
1789
-
wait() is used by a parent process to wait for the child process to finish execution.
1790
-
If wait is not used by a parent process then a child process might become a zombie process.
1791
-
</b></details>
1792
-
1793
1803
<details>
1794
1804
<summary>Explain Process Descriptor and Task Structure</summary><br><b>
1795
1805
</b></details>
@@ -1825,21 +1835,25 @@ There are many ways to answer that. For those who look for simplicity, the book
1825
1835
"responsible for making it easy to run programs (even allowing you to seemingly run many at the same time), allowing programs to share memory, enabling programs to interact with devices, and other fun stuff like that"
1826
1836
</b></details>
1827
1837
1838
+
#### Processes
1839
+
1840
+
<details>
1841
+
<summary>Can you explain what is a process?</summary><br><b>
1842
+
1843
+
A process is a running program. A program is one or more instructions and the program (or process) is executed by the operating system.
1844
+
</b></details>
1845
+
1828
1846
<details>
1829
1847
<summary>If you had to design an API for processes in an operating system, what would this API look like?</summary><br><b>
1830
1848
1849
+
It would support the following:
1850
+
1831
1851
* Create - allow to create new processes
1832
1852
* Delete - allow to remove/destroy processes
1833
1853
* State - allow to check the state of the process, whether it's running, stopped, waiting, etc.
1834
1854
* Stop - allow to stop a running process
1835
1855
</b></details>
1836
1856
1837
-
<details>
1838
-
<summary>Can you explain what is a process?</summary><br><b>
1839
-
1840
-
A process is a running program. A program is one or more instructions and the program (or process) is executed by the operating system.
1841
-
</b></details>
1842
-
1843
1857
<details>
1844
1858
<summary>How a process is created?</summary><br><b>
1845
1859
@@ -1867,6 +1881,12 @@ False. It was true in the past but today's operating systems perform lazy loadin
1867
1881
* Blocked - it's waiting for some operation to complete. For example I/O disk request
1868
1882
</b></details>
1869
1883
1884
+
#### Concurrency
1885
+
1886
+
<details>
1887
+
<summary>Explain what is Semaphore and what its role in operating systems</summary><br><b>
There are many other characteristics but these are the main ones that every python programmer should know.
2632
-
2633
2652
```
2634
2653
</b></details>
2635
2654
@@ -2650,13 +2669,13 @@ The immutable data types are:
2650
2669
Tuple
2651
2670
Frozenset
2652
2671
2653
-
You can usually use the function hash() to check an object mutability, if it is hashable it is immutable, although this does not always work as intended as user defined objects might be mutable and hashable
2672
+
You can usually use the function hash() to check an object mutability. If an object is hashable, it is immutable (although this does not always work as intended as user defined objects might be mutable and hashable).
2654
2673
</b></details>
2655
2674
2656
2675
<details>
2657
2676
<summary>In Python, functions are first-class objects. What does it mean?</summary><br><b>
2658
2677
2659
-
In general, first class objects in programming languages are objects which can assigned to variable, used as a return value and can be used as arguments or parameters.<br>
2678
+
In general, first class objects in programming languages are objects which can be assigned to variable, used as a return value and can be used as arguments or parameters.<br>
2660
2679
In python you can treat functions this way. Let's say we have the following function
2661
2680
2662
2681
```
@@ -2667,6 +2686,10 @@ def my_function():
2667
2686
You can then assign a function to a variables like this `x = my_function` or you can return functions as return values like this `return my_function`
2668
2687
</b></details>
2669
2688
2689
+
<details>
2690
+
<summary>Explain expressions and statements</summary><br><b>
2691
+
</b></details>
2692
+
2670
2693
<details>
2671
2694
<summary>What is PEP8? Give an example of 3 style guidelines</summary><br><b>
2672
2695
@@ -2822,25 +2845,19 @@ Generally, every compiling process have a two steps.
2822
2845
</b></details>
2823
2846
2824
2847
<details>
2825
-
<summary>What <code>//</code> is used for?</summary><br><b>
2848
+
<summary>Explain Exception Handling and how to use it in Python</summary><br><b>
2826
2849
</b></details>
2827
2850
2828
2851
<details>
2829
-
<summary>Write a program which will revert a string (e.g. pizza -> azzip)</summary><br><b>
2830
-
2831
-
```
2832
-
Shortest way is str[::-1] but not the most efficient.
2833
-
2834
-
"Classic" way:
2835
-
2836
-
foo = ''
2837
-
2838
-
for char in 'pizza':
2839
-
foo = char + foo
2852
+
<summary>Explain what is GIL</summary><br><b>
2853
+
</b></details>
2840
2854
2841
-
>> 'azzip'
2855
+
<details>
2856
+
<summary>What is Lambda? How is it used?</summary><br><b>
2857
+
</b></details>
2842
2858
2843
-
```
2859
+
<details>
2860
+
<summary>What <code>//</code> is used for?</summary><br><b>
<summary>Can you write a function which will print all the file in a given directory? including sub-directories</summary><br><b>
3007
-
</b></details>
3008
-
3009
3026
<details>
3010
3027
<summary>You have the following list: <code>[{'name': 'Mario', 'food': ['mushrooms', 'goombas']}, {'name': 'Luigi', 'food': ['mushrooms', 'turtles']}]</code>
3011
3028
Extract all type of foods. Final output should be: {'mushrooms', 'goombas', 'turtles'}</summary><br><b>
<summary>How to combine list of strings into one string with spaces between the strings</summary><br><b>
3093
3114
</b></details>
3094
3115
3116
+
<details>
3117
+
<summary>You have the following list of nested lists: <code>[['Mario', 90], ['Geralt', 82], ['Gordon', 88]]</code> How to sort the list by the numbers in the nested lists?</code></summary><br><b>
3118
+
3119
+
One way is:
3120
+
3121
+
the_list.sort(key=lambda x: x[1])
3122
+
</b></details>
3123
+
3095
3124
<details>
3096
3125
<summary>Explain the following:
3097
3126
* zip()
@@ -3101,6 +3130,8 @@ def reverse_string(string):
3101
3130
3102
3131
<details>
3103
3132
<summary>How do you debug Python code?</summary><br><b>
3133
+
3134
+
pdb :D
3104
3135
</b></details>
3105
3136
3106
3137
<details>
@@ -3238,7 +3269,7 @@ What would be the result of is_int(2) and is_int(False)?
3238
3269
##### Flask
3239
3270
3240
3271
<details>
3241
-
<summary>You wrote you have experience with Django/Flask. Can you describe what is Django/Flask and how you used it? Why Flask and not Djano? (or vice versa)</summary><br><b>
3272
+
<summary>You wrote you have experience with Django/Flask. Can you describe what is Django/Flask and how you have used it? Why Flask and not Djano? (or vice versa)</summary><br><b>
3242
3273
</b></details>
3243
3274
3244
3275
<details>
@@ -3660,6 +3691,12 @@ gitattributes allow you to define attributes per pathname or path pattern.<br>
3660
3691
You can use it for example to control endlines in files. In Windows and Unix based systems, you have different characters for new lines (\r\n and \n accordingly). So using gitattributes we can align it for both Windows and Unix with `* text=auto` in .gitattributes for anyone working with git. This is way, if you use the Git project in Windows you'll get \r\n and if you are using Unix or Linux, you'll get \n.
3661
3692
</b></details>
3662
3693
3694
+
<details>
3695
+
<summary>How do you discard local file changes?</summary><br><b>
0 commit comments