Python Online Screening TestBy Collab Team Contributor / February 8, 2025 Python Online Screening Test 1 / 20 Which Python construct is used to prevent race conditions in multithreading? ThreadPool GIL Lock Semaphore 2 / 20 What is the time complexity of accessing an element in a Python dictionary? O(1) O(n) O(log n) O(n^2) 3 / 20 Which of the following is an immutable data type in Python? Set Dictionary List Tuple 4 / 20 What will bool([]) return? True False None Error 5 / 20 What is the output of type(object())? Error None 6 / 20 Which module provides an efficient implementation of heap queue operations? heapq collections itertools queue 7 / 20 Which function in threading module starts a new thread? thread.run() thread.start() thread.execute() thread.call() 8 / 20 Which of the following methods can be used to remove an item from a dictionary safely? dict.delete(key) del dict[key] dict.pop(key, None) dict.remove(key) 9 / 20 What is the output of print(type(type))? 10 / 20 Which statement about Python sets is correct? Sets provide O(1) average-time complexity for lookups. Sets support indexing like lists. Sets allow duplicate elements. Sets are ordered collections. 11 / 20 Which statement about Python’s Global Interpreter Lock (GIL) is true? It prevents multiple threads from executing Python bytecode simultaneously. It allows true parallel execution of threads. It is only present in Jython. It improves Python’s multithreading performance. 12 / 20 Which of the following is NOT a magic method in Python? __call__() __del__() __str__() __private__() 13 / 20 Which function is used in asyncio to run an event loop? asyncio.call() asyncio.start() asyncio.run() asyncio.execute() 14 / 20 Which method is used to override an operator like + for a class? __operate__() __sum__() __add__() __plus__() 15 / 20 Which of the following is true about Python multiple inheritance? Python uses the C3 Linearization (MRO) algorithm. Multiple inheritance is done using super() only. Parent class methods override child class methods. Python does not support multiple inheritance. 16 / 20 Which module provides process-based parallelism in Python? multiprocessing threading concurrent.futures asyncio 17 / 20 Which function is used to dynamically import a module in Python? importlib.import_module() load_module() exec() __import__() 18 / 20 Which method is called when an object is created? __init__() __new__() __create__() __start__() 19 / 20 Which method can be used to check if a class is a subclass of another class? checkSubclass() isinstance() isSubclass() issubclass() 20 / 20 Which data structure in Python maintains insertion order but does not allow duplicate keys? Tuple List Set Dictionary (Python 3.7+) Your score isThe average score is 45% 0% Restart quiz