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