├── README.md ├── general_questions └── README.md └── python └── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Interview Questions :desktop_computer: 2 | 3 | The goal of this repository is to share some questions that are asked 4 | during interviews to occupy a charge as a Softaware Developer. 5 | 6 | The idea is to include questions with several programming languages and also general questions. (Design patters, SOLID, Arquitecture Patterns, DataBases. etc). 7 | 8 | Contributions are welcome to this repository. Feel free to send your pull requests. :grinning: 9 | -------------------------------------------------------------------------------- /general_questions/README.md: -------------------------------------------------------------------------------- 1 | # Software Enginering Questions 2 | 3 | 1 - Mention SOLID principles 4 | 5 | * In this question it would be a good idea mention some examples about each principle. 6 | * Here a resource that implements these principles by using PHP. [SOLID principles](https://www.digitalocean.com/community/conceptual_articles/s-o-l-i-d-the-first-five-principles-of-object-oriented-design) 7 | 8 | 2 - Describe object-oriented programming's pillars. 9 | 10 | 3 - What is Composition ? 11 | 12 | 4 - What is the difference between Inheritance and Composition ? 13 | 14 | 5 - Mention some design patterns 15 | 16 | * For this question, it's recommended to learn to implement each one of these patterns in your favorite programming language. 17 | * Here a good resource [Design patterns](https://refactoring.guru/design-patterns) 18 | 19 | 6 - Mention software arqitecture patterns 20 | 21 | 7 - What is the difference between concurrency and parallelism? 22 | 23 | 8 - What is a message queuing systems? What is used for ? 24 | 25 | # Databases 26 | 27 | 1 - What is a Storage Procedure (SP) ? 28 | 29 | 2 - What are triggers ? 30 | 31 | 3 - What is a transaction ? 32 | 33 | 4 - What are the indexes in a database used for? 34 | 35 | 5 - What is the difference between a Relational Database and Not Relational Database ? 36 | -------------------------------------------------------------------------------- /python/README.md: -------------------------------------------------------------------------------- 1 | # Python Questions :snake: 2 | 3 | 1 - Mention Python Data Types 4 | 5 | * [Here](https://www.javatpoint.com/python-data-types) you can find info about it. 6 | 7 | > It's highly recomended to know about what types are mutable and inmutables. That's why I'll incude some resources: 8 | 9 | * [What are mutable and immutable objects in Python3?](https://www.educative.io/edpresso/what-are-mutable-and-immutable-objects-in-python3) 10 | * [Mutable vs Immutable Objects in Python](https://www.freecodecamp.org/news/mutable-vs-immutable-objects-python/) 11 | 12 | 13 | 2 - Differences between a list and a tuple. 14 | 15 | * Read this [post](https://stackabuse.com/lists-vs-tuples-in-python) to learn about these defferences 16 | 17 | 3 - What is the best way to copy a list? 18 | * Talk about deep and shallow copy. Read this [post](https://www.programiz.com/python-programming/shallow-deep-copy) 19 | 20 | 4 - After calling this function twice, what is the output? Why? 21 | ``` py 22 | >>> def default_list(L=[]): 23 | >>> L.append(1) 24 | >>> print(L) 25 | 26 | >>> default_list() 27 | # output ??? 28 | >>> default_list() 29 | # output ??? 30 | ``` 31 | * In order to understand this behavior, read this [post](https://docs.python-guide.org/writing/gotchas/) 32 | 33 | 5 - What is the output of this code? 34 | ``` py 35 | >>> a = [1, 2, 3] 36 | >>> b = a 37 | >>> a.append([4, 5]) 38 | >>> print(b) 39 | # output ??? 40 | ``` 41 | 6 - Which of the following two implementations would you prefer? Why? 42 | ``` py 43 | # First option 44 | 45 | >>> def print_numbers(a, b): 46 | >>> for i in range(a, b+1): 47 | >>> print(i) 48 | ``` 49 | 50 | ``` py 51 | # Second option 52 | 53 | >>> def print_numbers(a, b): 54 | >>> nums = [i for i in range(a, b+1)] 55 | >>> for i in nums: 56 | >>> print(i) 57 | ``` 58 | > Note: The functions perform the same. 59 | 60 | 7 - what is a Lambda function ? 61 | 62 | * In this article you can learn about [Lambda functions](https://realpython.com/python-lambda/) 63 | 64 | 8 - Explain the output of these two lines of code. 65 | 66 | ``` py 67 | >>> round(1.5) 68 | 2 69 | >>> round(2.5) 70 | 2 71 | ``` 72 | * Read about [round-bias](https://realpython.com/python-rounding/) 73 | 74 | 9 - What is a decorator? Write an example. 75 | 76 | * [Decorators](https://www.programiz.com/python-programming/decorator) 77 | 78 | 10 - What is the output after executing the following code snippet: 79 | ``` py 80 | >>> def func(num): 81 | >>> return lambda x: num + x 82 | 83 | >>> print(func(2)(3)) 84 | # ouput ? 85 | >>> print(func("x")("y") + "z") 86 | # output ? 87 | ``` 88 | 89 | 11 - What is generator and generator expresion? When would you use a generator? 90 | 91 | * Learn about [generators](https://www.programiz.com/python-programming/generator) 92 | 93 | 12 - What is an iterator? 94 | 95 | * [Python Iterators](https://www.programiz.com/python-programming/iterator) 96 | * [The Iterator Protocol: How "For Loops" Work in Python](https://treyhunner.com/2016/12/python-iterator-protocol-how-for-loops-work/) 97 | 98 | 13 - What is the difference between a generator function and normal function? 99 | 100 | 14 - How does Python manage the memory? 101 | 102 | * Read [here](https://realpython.com/python-memory-management/) 103 | 104 | 15 - What is the GIL (Global Interpreter Lock)? 105 | 106 | * You can read this [post](https://realpython.com/python-gil/) 107 | * I also recomend to watch this [video](https://www.youtube.com/watch?v=-VH2EvvOCzU) 108 | 109 | 16 - How do you implement an Enumerador? 110 | 111 | * Read [this](https://docs.python.org/3/library/enum.html) 112 | 113 | 17 - What is a Context Manager? How do you implement a Context Manager ? What happen if occur an exception? 114 | 115 | * Read about [Context Managers](https://realpython.com/python-with-statement/#creating-custom-context-managers) 116 | 117 | 18 - Explain the output of this code. 118 | ``` py 119 | >>> numbers = [1, 2, 3, 5, 7] 120 | >>> squares = (n**2 for n in numbers) 121 | >>> 4 in squares 122 | True 123 | >>> 4 in squares 124 | False 125 | ``` 126 | * Read this article in order to understand this output. [Loop better: A deeper look at iteration in Python](https://opensource.com/article/18/3/loop-better-deeper-look-iteration-python) 127 | 128 | 19 - How do you manage Python Exceptions ? 129 | ``` py 130 | >>> try: 131 | >>> print(x) 132 | >>> except: 133 | >>> print("An exception occurred") 134 | ``` 135 | > It's highly recommended that you learn to write user-defined exceptions. 136 | 137 | * [Here](https://www.programiz.com/python-programming/user-defined-exception) you can learn about this topic. 138 | 139 | 20 - What are `*args` and `**kwargs` used in Python for? 140 | 141 | * [Python *args and **kwargs](https://www.programiz.com/python-programming/args-and-kwargs#:~:text=*args%20and%20**kwargs%20are,to%20take%20variable%20length%20argument.&text=**kwargs%20passes%20variable%20number,kwargs%20make%20the%20function%20flexible.) 142 | 143 | 21 - How does Python implement concurrency and parallelism? 144 | 145 | 22 - How do you implement a coroutine in Python? 146 | 147 | 23 - Mention some python built-in decorators and what are they used for ? 148 | 149 | * `staticmethod` 150 | * `classmethod` 151 | * search for others :) 152 | 153 | 24 - What is the main difference between Django and Flask ? 154 | 155 | 25 - What is the difference between `classmethod` and `staticmethod` ? 156 | 157 | 26 - Mention some Python data structures with constant `O(1)` access time complexity. 158 | 159 | 27 - Iterator vs Generator 160 | 161 | 28 - What are the ways to define a decorator in Python ? 162 | 163 | 29 - When to use concurrency and parallelism in Python? 164 | 165 | 30 - Look at the following piece of code: 166 | 167 | ```python 168 | var1 = "Hello" 169 | var2 = "Hello" 170 | ``` 171 | Are var1 and var2 pointing to the same object ? Why ? 172 | 173 | 31 - what is the difference between `==` and `is` ? 174 | 175 | 32 - For searching an element in a Python list, what is the time complexity? 176 | 177 | 33 - What are the differences between a lambda function and normal function in Python ? 178 | 179 | --------------------------------------------------------------------------------