Question 10 (Advanced):
In the Transformer architecture (PyTorch), what is the purpose of masked multi-head attention in the decoder?
A) To prevent the model from peeking at future tokens during training
B) To reduce GPU memory usage
C) To handle variable-length input sequences
D) To normalize gradient updates
#Python #Transformers #DeepLearning #NLP #AI
✅ By: https://t.me/DataScienceQ
In the Transformer architecture (PyTorch), what is the purpose of masked multi-head attention in the decoder?
A) To prevent the model from peeking at future tokens during training
B) To reduce GPU memory usage
C) To handle variable-length input sequences
D) To normalize gradient updates
#Python #Transformers #DeepLearning #NLP #AI
✅ By: https://t.me/DataScienceQ
❤2
Question 11 (Expert):
In Vision Transformers (ViT), how are image patches typically converted into input tokens for the transformer encoder?
A) Raw pixel values are used directly
B) Each patch is flattened and linearly projected
C) Patches are processed through a CNN first
D) Edge detection is applied before projection
#Python #ViT #ComputerVision #DeepLearning #Transformers
✅ By: https://t.me/DataScienceQ
In Vision Transformers (ViT), how are image patches typically converted into input tokens for the transformer encoder?
A) Raw pixel values are used directly
B) Each patch is flattened and linearly projected
C) Patches are processed through a CNN first
D) Edge detection is applied before projection
#Python #ViT #ComputerVision #DeepLearning #Transformers
✅ By: https://t.me/DataScienceQ
❤1
Question 12 (Intermediate):
What is the key difference between
A) Classmethods can modify class state, staticmethods can't
B) Staticmethods are inherited, classmethods aren't
C) Classmethods receive implicit first argument (cls), staticmethods receive no special first argument
D) Classmethods are faster to execute
#Python #OOP #ClassMethod #StaticMethod
✅ By: https://t.me/DataScienceQ
What is the key difference between
@classmethod
and @staticmethod
in Python OOP? A) Classmethods can modify class state, staticmethods can't
B) Staticmethods are inherited, classmethods aren't
C) Classmethods receive implicit first argument (cls), staticmethods receive no special first argument
D) Classmethods are faster to execute
#Python #OOP #ClassMethod #StaticMethod
✅ By: https://t.me/DataScienceQ
❤3
Question 13 (Intermediate):
In NumPy, what is the difference between
A) The first is a 1D array, the second is a 2D row vector
B) The first is faster to compute
C) The second automatically transposes the data
D) They are identical in memory usage
#Python #NumPy #Arrays #DataScience
✅ By: https://t.me/DataScienceQ
In NumPy, what is the difference between
np.array([1, 2, 3])
and np.array([[1, 2, 3]])
? A) The first is a 1D array, the second is a 2D row vector
B) The first is faster to compute
C) The second automatically transposes the data
D) They are identical in memory usage
#Python #NumPy #Arrays #DataScience
✅ By: https://t.me/DataScienceQ
❤3
Question 1 (Advanced):
When using Python's
A) Windows lacks proper fork() implementation
B) Linux handles memory management differently
C) macOS has better garbage collection
D) Windows requires explicit process naming
#Python #Multiprocessing #ParallelComputing #Advanced
✅ By: https://t.me/DataScienceQ
When using Python's
multiprocessing
module, why is if __name__ == '__main__':
required for Windows but often optional for Linux/macOS? A) Windows lacks proper fork() implementation
B) Linux handles memory management differently
C) macOS has better garbage collection
D) Windows requires explicit process naming
#Python #Multiprocessing #ParallelComputing #Advanced
✅ By: https://t.me/DataScienceQ
Question 2 (Expert):
In Python's GIL (Global Interpreter Lock), what is the primary reason it allows only one thread to execute Python bytecode at a time, even on multi-core systems?
A) To prevent race conditions in memory management
B) To simplify the CPython implementation
C) To reduce power consumption
D) To improve single-thread performance
#Python #GIL #Concurrency #CPython
✅ By: https://t.me/DataScienceQ
In Python's GIL (Global Interpreter Lock), what is the primary reason it allows only one thread to execute Python bytecode at a time, even on multi-core systems?
A) To prevent race conditions in memory management
B) To simplify the CPython implementation
C) To reduce power consumption
D) To improve single-thread performance
#Python #GIL #Concurrency #CPython
✅ By: https://t.me/DataScienceQ
Question 3 (Intermediate):
In Tkinter, what is the correct way to make a widget expand to fill available space in its parent container?
A)
B)
C)
D) All of the above
#Python #Tkinter #GUI #Widgets
✅ By: https://t.me/DataScienceQ
In Tkinter, what is the correct way to make a widget expand to fill available space in its parent container?
A)
widget.pack(expand=True)
B)
widget.grid(sticky='nsew')
C)
widget.place(relwidth=1.0)
D) All of the above
#Python #Tkinter #GUI #Widgets
✅ By: https://t.me/DataScienceQ
Question 4 (Intermediate):
In scikit-learn's KMeans implementation, what is the purpose of the
A) Number of initial centroid configurations to try
B) Number of iterations for each run
C) Number of features to initialize
D) Number of CPU cores to use
#Python #KMeans #Clustering #MachineLearning
✅ By: https://t.me/DataScienceQ
In scikit-learn's KMeans implementation, what is the purpose of the
n_init
parameter? A) Number of initial centroid configurations to try
B) Number of iterations for each run
C) Number of features to initialize
D) Number of CPU cores to use
#Python #KMeans #Clustering #MachineLearning
✅ By: https://t.me/DataScienceQ
❤2
Question 20 (Beginner):
What is the output of this Python code?
A)
B)
C)
D) Raises an error
#Python #Lists #Variables #Beginner
✅ By: https://t.me/DataScienceQ
✅ **Correct answer: B) `[1, 2, 3, 4]`**
*Explanation:
- `y = x` creates a reference to the same list object
- Modifying `y` affects `x` because they point to the same memory location
- To create an independent copy, use or *
What is the output of this Python code?
x = [1, 2, 3]
y = x
y.append(4)
print(x)
A)
[1, 2, 3]
B)
[1, 2, 3, 4]
C)
[4, 3, 2, 1]
D) Raises an error
#Python #Lists #Variables #Beginner
✅ By: https://t.me/DataScienceQ
*Explanation:
- `y = x` creates a reference to the same list object
- Modifying `y` affects `x` because they point to the same memory location
- To create an independent copy, use
y = x.copy()
y = list(x)
Question 21 (Beginner):
What is the correct way to check the Python version installed on your system using the command line?
A)
B)
C)
D)
#Python #Basics #Programming #Beginner
✅ By: https://t.me/DataScienceQ
What is the correct way to check the Python version installed on your system using the command line?
A)
python --version
B)
python -v
C)
python --v
D)
python version
#Python #Basics #Programming #Beginner
✅ By: https://t.me/DataScienceQ
❤1
Question 22 (Interview-Level):
Explain the difference between
Options:
A) Both modify the original list
B)
C) Shallow copy affects nested objects, deepcopy doesn't
D)
#Python #Interview #DeepCopy #MemoryManagement
✅ By: https://t.me/DataScienceQ
Explain the difference between
deepcopy
and regular assignment (=
) in Python with a practical example. Then modify the example to show how deepcopy
solves the problem. import copy
# Original Problem
original = [[1, 2], [3, 4]]
shallow_copy = original.copy()
shallow_copy[0][0] = 99
print(original) # What happens here?
# Solution with deepcopy
deep_copied = copy.deepcopy(original)
deep_copied[1][0] = 77
print(original) # What happens now?
Options:
A) Both modify the original list
B)
copy()
creates fully independent copies C) Shallow copy affects nested objects, deepcopy doesn't
D)
deepcopy
is slower but creates true copies #Python #Interview #DeepCopy #MemoryManagement
✅ By: https://t.me/DataScienceQ
❤2
Question 23 (Advanced):
How does Python's "Name Mangling" (double underscore prefix) work in class attribute names, and what's its practical purpose?
Options:
A) Completely hides the attribute
B) Renames it to
C) Makes it immutable
D) Converts it to a method
#Python #OOP #NameMangling #Advanced
✅ By: https://t.me/DataScienceQ
How does Python's "Name Mangling" (double underscore prefix) work in class attribute names, and what's its practical purpose?
class Test:
def __init__(self):
self.public = 10
self._protected = 20
self.__private = 30 # Name mangling
obj = Test()
print(dir(obj)) # What happens to __private?
Options:
A) Completely hides the attribute
B) Renames it to
_Test__private
C) Makes it immutable
D) Converts it to a method
#Python #OOP #NameMangling #Advanced
✅ By: https://t.me/DataScienceQ
Question 24 (Advanced - NSFW Detection):
When implementing NSFW (Not Safe For Work) content detection in Python, which of these approaches provides the best balance between accuracy and performance?
A) Rule-based keyword filtering
B) CNN-based image classification (e.g., MobileNetV2)
C) Transformer-based multimodal analysis (e.g., CLIP)
D) Metadata analysis (EXIF data, file properties)
#Python #NSFW #ComputerVision #DeepLearning
✅ By: https://t.me/DataScienceQ
When implementing NSFW (Not Safe For Work) content detection in Python, which of these approaches provides the best balance between accuracy and performance?
A) Rule-based keyword filtering
B) CNN-based image classification (e.g., MobileNetV2)
C) Transformer-based multimodal analysis (e.g., CLIP)
D) Metadata analysis (EXIF data, file properties)
#Python #NSFW #ComputerVision #DeepLearning
✅ By: https://t.me/DataScienceQ
❤2
Question 25 (Advanced - CNN Implementation in Keras):
When building a CNN for image classification in Keras, what is the purpose of Global Average Pooling 2D as the final layer before classification?
A) Reduces spatial dimensions to 1x1 while preserving channel depth
B) Increases receptive field for better feature extraction
C) Performs pixel-wise normalization
D) Adds non-linearity before dense layers
#Python #Keras #CNN #DeepLearning
✅ By: https://t.me/DataScienceQ
When building a CNN for image classification in Keras, what is the purpose of Global Average Pooling 2D as the final layer before classification?
A) Reduces spatial dimensions to 1x1 while preserving channel depth
B) Increases receptive field for better feature extraction
C) Performs pixel-wise normalization
D) Adds non-linearity before dense layers
#Python #Keras #CNN #DeepLearning
✅ By: https://t.me/DataScienceQ
❤1
Question 26 (Intermediate - Edge Detection):
In Python's OpenCV, which of these edge detection techniques preserves edge directionality while reducing noise?
A)
B)
C)
D)
#Python #OpenCV #EdgeDetection #ComputerVision
✅ By: https://t.me/DataScienceQ
In Python's OpenCV, which of these edge detection techniques preserves edge directionality while reducing noise?
A)
cv2.Laplacian()
B)
cv2.Canny()
C)
cv2.Sobel()
with dx=1, dy=1 D)
cv2.blur()
+ thresholding #Python #OpenCV #EdgeDetection #ComputerVision
✅ By: https://t.me/DataScienceQ
Question 27 (Intermediate - List Operations):
What is the time complexity of the
A) O(1) - Constant time (like appending)
B) O(n) - Linear time (shifts all elements)
C) O(log n) - Logarithmic time (binary search)
D) O(n²) - Quadratic time (worst-case)
#Python #DataStructures #TimeComplexity #Lists
✅ By: https://t.me/DataScienceQ
What is the time complexity of the
list.insert(0, item)
operation in Python, and why? A) O(1) - Constant time (like appending)
B) O(n) - Linear time (shifts all elements)
C) O(log n) - Logarithmic time (binary search)
D) O(n²) - Quadratic time (worst-case)
#Python #DataStructures #TimeComplexity #Lists
✅ By: https://t.me/DataScienceQ
Question 30 (Intermediate - PyTorch):
What is the purpose of
A) Disables model training
B) Speeds up computations by disabling gradient tracking
C) Forces GPU memory cleanup
D) Enables distributed training
#Python #PyTorch #DeepLearning #NeuralNetworks
✅ By: https://t.me/DataScienceQ
What is the purpose of
torch.no_grad()
context manager in PyTorch? A) Disables model training
B) Speeds up computations by disabling gradient tracking
C) Forces GPU memory cleanup
D) Enables distributed training
#Python #PyTorch #DeepLearning #NeuralNetworks
✅ By: https://t.me/DataScienceQ
🔥1
Question 31 (Intermediate - Django ORM):
When using Django ORM's
A)
B) Both methods generate exactly one SQL query
C)
D)
#Python #Django #ORM #Database
✅ By: https://t.me/DataScienceQ
When using Django ORM's
select_related()
and prefetch_related()
for query optimization, which statement is correct? A)
select_related
uses JOINs (1 SQL query) while prefetch_related
uses 2+ queries B) Both methods generate exactly one SQL query
C)
prefetch_related
works only with ForeignKey relationships D)
select_related
is better for many-to-many relationships #Python #Django #ORM #Database
✅ By: https://t.me/DataScienceQ
🔥1
Question 32 (Advanced - NLP & RNNs):
What is the key limitation of vanilla RNNs for NLP tasks that led to the development of LSTMs and GRUs?
A) Vanishing gradients in long sequences
B) High GPU memory usage
C) Inability to handle embeddings
D) Single-direction processing only
#Python #NLP #RNN #DeepLearning
✅ By: https://t.me/DataScienceQ
What is the key limitation of vanilla RNNs for NLP tasks that led to the development of LSTMs and GRUs?
A) Vanishing gradients in long sequences
B) High GPU memory usage
C) Inability to handle embeddings
D) Single-direction processing only
#Python #NLP #RNN #DeepLearning
✅ By: https://t.me/DataScienceQ
Telegram
Python Data Science Jobs & Interviews
Your go-to hub for Python and Data Science—featuring questions, answers, quizzes, and interview tips to sharpen your skills and boost your career in the data-driven world.
Admin: @Hussein_Sheikho
Admin: @Hussein_Sheikho
❤2
🚀 Comprehensive Guide: How to Prepare for an Image Processing Job Interview – 500 Most Common Interview Questions
Let's start: https://hackmd.io/@husseinsheikho/IP
#ImageProcessing #ComputerVision #OpenCV #Python #InterviewPrep #DigitalImageProcessing #MachineLearning #AI #SignalProcessing #ComputerGraphics
Let's start: https://hackmd.io/@husseinsheikho/IP
#ImageProcessing #ComputerVision #OpenCV #Python #InterviewPrep #DigitalImageProcessing #MachineLearning #AI #SignalProcessing #ComputerGraphics
✉️ Our Telegram channels: https://t.me/addlist/0f6vfFbEMdAwODBk📱 Our WhatsApp channel: https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Please open Telegram to view this post
VIEW IN TELEGRAM
❤1