❔ Interview question
What is the purpose of a pooling layer in a Convolutional Neural Network (CNN)?
Answer:A pooling layer (like Max Pooling or Average Pooling) is used to progressively reduce the spatial size (width and height) of the feature maps. This serves two main purposes: 1) It reduces the number of parameters and computational complexity, which helps to control overfitting. 2) It introduces a degree of translation invariance, meaning the network becomes more robust to small shifts and distortions in the position of features in the input image.
tags: #interview #cnn #deeplearning
━━━━━━━━━━━━━━━
By: @DataScienceQ ✨
What is the purpose of a pooling layer in a Convolutional Neural Network (CNN)?
Answer:
tags: #interview #cnn #deeplearning
━━━━━━━━━━━━━━━
By: @DataScienceQ ✨
❔ Interview question
What is the difference between the
Answer: Theis for loose comparison, checking for value equality after type juggling. For example, is for strict comparison, checking for both value AND type equality, without any type conversion. So, to use to avoid unexpected bugs.
tags: #interview #php
━━━━━━━━━━━━━━━
By: @DataScienceQ ✨
What is the difference between the
== (loose comparison) and === (strict comparison) operators in PHP?Answer: The
== operator 1 == "1" is true. The === operator 1 === "1" is false. It's generally safer ===tags: #interview #php
━━━━━━━━━━━━━━━
By: @DataScienceQ ✨
❔ Interview question
What is the difference between
Answer:only if a variable is declared and is not . In contrast, is considered "falsy", which includes or an empty array. A key difference is that a variable like is set (so is true), but also considered empty (so is true).
tags: #interview #php
━━━━━━━━━━━━━━━
By: @DataScienceQ ✨
What is the difference between
isset() and empty() in PHP?Answer:
isset() returns true NULLempty() returns true if a variable NULL, false, 0, "0", an empty string "", $var = 0; isset()empty()tags: #interview #php
━━━━━━━━━━━━━━━
By: @DataScienceQ ✨
❤1
❔ Interview question
Why is it better to use
Answer: Becausehandles cross-platform compatibility automatically. Operating systems use different path separators (e.g., for Linux/macOS and for Windows). Hardcoding a separator like will break on a different OS. or depending on the system, making the code robust and portable.
tags: #interview #python #os
━━━━━━━━━━━━━━━
By: @DataScienceQ ✨
Why is it better to use
os.path.join() to construct paths instead of simple string concatenation?Answer: Because
os.path.join() /\'folder' + '/' + 'file' os.path.join('folder', 'file') correctly produces folder/filefolder\filetags: #interview #python #os
━━━━━━━━━━━━━━━
By: @DataScienceQ ✨
❤1
How to get the current module's name?
Answer:
tags:
Please open Telegram to view this post
VIEW IN TELEGRAM
❤1
❔ Interview question
When would you use the
Answer:The attribute is used for memory optimization. By defining it in a class, you prevent the creation of a for each instance, instead allocating a fixed amount of space for the specified attributes. This is highly effective when creating a large number of objects. The primary trade-off is that you lose the ability to add new attributes to instances at runtime.
tags: #python #interview
━━━━━━━━━━━━━━━
By: @DataScienceQ ✨
When would you use the
__slots__ attribute in a Python class, and what is its main trade-off?Answer:
__slots____dict__tags: #python #interview
━━━━━━━━━━━━━━━
By: @DataScienceQ ✨
What is
None in Python?Answer:
tags: #interview
Please open Telegram to view this post
VIEW IN TELEGRAM
What is GIL in Python, why is it needed, and how can it be bypassed?
Answer:
However, due to the GIL, multithreading in Python does not provide true CPU-level parallelism: even if multiple threads are created, they will run sequentially rather than simultaneously, which limits performance in computationally intensive tasks.
This limitation can be bypassed by using modules like multiprocessing, which run separate processes with their own memory and their own GIL. Heavy logic can also be moved to native C extensions or interpreters without a GIL, such as Jython or experimental versions of PyPy.
tags: #interview
Please open Telegram to view this post
VIEW IN TELEGRAM
What is the difference between asynchrony, multithreading, and multiprocessing?
Answer:
Multithreading uses multiple threads within one process that share memory and can run in parallel with coordination among them.
Multiprocessing launches several isolated processes, each with its own address space and resources, allowing true parallelism at the CPU level.
Simply put, asynchrony is efficient for I/O tasks, threads are used for tasks with shared data, and processes are for resource-intensive computations where load distribution across cores is important.
tags: #interview
Please open Telegram to view this post
VIEW IN TELEGRAM
❤1
How to view an object's methods?
Answer:
tags: #interview
Please open Telegram to view this post
VIEW IN TELEGRAM
❤2🔥1
❔ Interview Question
What is the GIL (Global Interpreter Lock) in Python, and how does it impact the execution of multi-threaded programs?
Answer: The Global Interpreter Lock (GIL) is a mutex (or a lock) that allows only one thread to hold the control of the Python interpreter at any one time. This means that in a CPython process, only one thread can be executing Python bytecode at any given moment, even on a multi-core processor.
This has a significant impact on performance:
• For CPU-bound tasks: Multi-threaded Python programs see no performance gain from multiple CPU cores. If you have a task that performs heavy calculations (e.g., image processing, complex math), creating multiple threads will not make it run faster. The threads will execute sequentially, not in parallel, because they have to take turns acquiring the GIL.
• For I/O-bound tasks: The GIL is less of a problem. When a thread is waiting for Input/Output (I/O) operations (like waiting for a network response, reading from a file, or querying a database), it releases the GIL. This allows another thread to run. Therefore, the
How to achieve true parallelism?
To bypass the GIL and leverage multiple CPU cores for CPU-bound tasks, you must use the
tags: #Python #Interview #CodingInterview #GIL #Concurrency #Threading #Multiprocessing #SoftwareEngineering
━━━━━━━━━━━━━━━
By: @DataScienceQ ✨
What is the GIL (Global Interpreter Lock) in Python, and how does it impact the execution of multi-threaded programs?
Answer: The Global Interpreter Lock (GIL) is a mutex (or a lock) that allows only one thread to hold the control of the Python interpreter at any one time. This means that in a CPython process, only one thread can be executing Python bytecode at any given moment, even on a multi-core processor.
This has a significant impact on performance:
• For CPU-bound tasks: Multi-threaded Python programs see no performance gain from multiple CPU cores. If you have a task that performs heavy calculations (e.g., image processing, complex math), creating multiple threads will not make it run faster. The threads will execute sequentially, not in parallel, because they have to take turns acquiring the GIL.
• For I/O-bound tasks: The GIL is less of a problem. When a thread is waiting for Input/Output (I/O) operations (like waiting for a network response, reading from a file, or querying a database), it releases the GIL. This allows another thread to run. Therefore, the
threading module is still highly effective for tasks that spend most of their time waiting, as it allows for concurrency.How to achieve true parallelism?
To bypass the GIL and leverage multiple CPU cores for CPU-bound tasks, you must use the
multiprocessing module. It creates separate processes, each with its own Python interpreter and memory space, so the GIL of one process does not affect the others.tags: #Python #Interview #CodingInterview #GIL #Concurrency #Threading #Multiprocessing #SoftwareEngineering
━━━━━━━━━━━━━━━
By: @DataScienceQ ✨
❤1
What objects can be put into a set?
Answer:
Objects like list, dict, set, and other mutable structures cannot be put in: they do not have a hash function (hash) and will cause a TypeError.
ta
Please open Telegram to view this post
VIEW IN TELEGRAM
❤1
What can be a key in a dictionary?
Answer:
tags: #interview
Please open Telegram to view this post
VIEW IN TELEGRAM
❤3
What is a deep copy?
Answer:
In Python, this is done using copy.deepcopy(), which creates a fully independent data structure, including nested lists, dictionaries, and other objects.
tags: #interview
Please open Telegram to view this post
VIEW IN TELEGRAM
👍4❤1
Why does
list.sort() return None instead of the sorted list?Answer:
If a new sorted list is needed, the built-in sorted() function is used, which returns the result without changing the original.
tags: #interview
Please open Telegram to view this post
VIEW IN TELEGRAM
Are there generics in Python like in Java or C++?
Answer:
tags: #interview
Please open Telegram to view this post
VIEW IN TELEGRAM
What do you know about NoSQL databases?
Answer:
These databases scale well horizontally: data is distributed across cluster nodes, which helps handle high loads and large volumes. Different storage models are supported — key-value, document, columnar, and graph. This allows choosing the appropriate structure for a specific task.
Common systems include MongoDB (documents), Cassandra (columns), Redis (key-value), and Neo4j (graphs). They are used where scalability, speed, and data flexibility are important.
tags: #interview
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegram
PyData Careers
Python Data Science jobs, interview tips, and career insights for aspiring professionals.
What does it mean that a QuerySet in Django is "lazy"?
Answer:
The actual database access happens only when the results are really needed: when iterating over the QuerySet, calling list(), count(), first(), exists(), and other methods that require data.
This approach helps avoid unnecessary database hits and improves performance — queries are executed only at the moment of real necessity.
tags: #interview
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegram
PyData Careers
Python Data Science jobs, interview tips, and career insights for aspiring professionals.
👍1
What is the difference between calling
start() and run() on threading.Thread?Answer:
If you call run() directly, it will execute in the current thread like a normal function — without creating a new thread and without parallelism.
This is the key difference: start() launches a separate execution thread, while run() just runs the code in the same thread.
tags: #interview
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegram
PyData Careers
Python Data Science jobs, interview tips, and career insights for aspiring professionals.
👍1
What does
nonlocal do and where can it be used?Answer:
This is often used in closures to maintain and update state between calls to the nested function.
tags: #interview
Please open Telegram to view this post
VIEW IN TELEGRAM
❤2