Uncategorized Python Online Screening Test by Collab Team Contributor Feb 8, 2025 0 Comment Python Online Screening Test 1 / 20 Which of the following is an immutable data type in Python? List Tuple Set Dictionary 2 / 20 What is the output of type(object())? Error None 3 / 20 Which function in threading module starts a new thread? thread.execute() thread.run() thread.start() thread.call() 4 / 20 What is the time complexity of accessing an element in a Python dictionary? O(log n) O(n) O(n^2) O(1) 5 / 20 Which of the following is NOT a magic method in Python? __str__() __del__() __call__() __private__() 6 / 20 Which statement about Python sets is correct? Sets are ordered collections. Sets allow duplicate elements. Sets support indexing like lists. Sets provide O(1) average-time complexity for lookups. 7 / 20 Which method can be used to check if a class is a subclass of another class? isinstance() isSubclass() checkSubclass() issubclass() 8 / 20 What is the output of print(type(type))? 9 / 20 Which method is used to override an operator like + for a class? __plus__() __sum__() __operate__() __add__() 10 / 20 Which function is used to dynamically import a module in Python? exec() load_module() __import__() importlib.import_module() 11 / 20 Which module provides an efficient implementation of heap queue operations? itertools heapq collections queue 12 / 20 Which function is used in asyncio to run an event loop? asyncio.execute() asyncio.start() asyncio.run() asyncio.call() 13 / 20 Which module provides process-based parallelism in Python? concurrent.futures asyncio threading multiprocessing 14 / 20 Which data structure in Python maintains insertion order but does not allow duplicate keys? Dictionary (Python 3.7+) Tuple Set List 15 / 20 What will bool([]) return? None True Error False 16 / 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. 17 / 20 Which of the following methods can be used to remove an item from a dictionary safely? dict.remove(key) dict.delete(key) del dict[key] dict.pop(key, None) 18 / 20 Which Python construct is used to prevent race conditions in multithreading? GIL Semaphore Lock ThreadPool 19 / 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. 20 / 20 Which method is called when an object is created? __new__() __create__() __init__() __start__() Your score isThe average score is 45% 0% Restart quiz
Leave a Reply Cancel replyYour email address will not be published. Required fields are marked *Comment Name* Email* Save my name, email, and website in this browser for the next time I comment.
Leave a Reply