Question 8 (Advanced):
What is the time complexity of checking if an element exists in a Python
A) O(1)
B) O(n)
C) O(log n)
D) O(n^2)
#Python #DataStructures #TimeComplexity #Advanced
✅ By: https://yangx.top/DataScienceQ
What is the time complexity of checking if an element exists in a Python
set
?A) O(1)
B) O(n)
C) O(log n)
D) O(n^2)
#Python #DataStructures #TimeComplexity #Advanced
✅ By: https://yangx.top/DataScienceQ
❤1
Question 9 (Intermediate):
In SciPy, which function is used to solve ordinary differential equations (ODEs)?
A)
B)
C)
D)
#Python #SciPy #NumericalMethods #ODEs
✅ By: https://yangx.top/DataScienceQ
In SciPy, which function is used to solve ordinary differential equations (ODEs)?
A)
scipy.optimize.minimize()
B)
scipy.integrate.solve_ivp()
C)
scipy.signal.lfilter()
D)
scipy.linalg.solve()
#Python #SciPy #NumericalMethods #ODEs
✅ By: https://yangx.top/DataScienceQ
❤2
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://yangx.top/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://yangx.top/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://yangx.top/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://yangx.top/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://yangx.top/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://yangx.top/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://yangx.top/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://yangx.top/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://yangx.top/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://yangx.top/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://yangx.top/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://yangx.top/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://yangx.top/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://yangx.top/DataScienceQ