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