Python Asynchronous Programming FP MCQs Answers
Course Path: Data Science/DATA SCIENTIST'S TOOLBOX/Python Asynchronous Programming
All Question of the Quiz Present Below for Ease Use Ctrl + F to find the Question.
Suggestion: If you didn't find the question, Search by options to get a more accurate result.
Intermediate Quiz
1.Multiple threads running on the same CPU core is ______.
Parallelism
Concurrency
Multiprocessing
Asynchronous
Answer: 2)Concurrency
2.asyncio was introduced in _______ version of Python.
3.6
3.5
3.4
3.7
Answer: 3)3.4
3.asyncio is generally perfect for ___ apps.
Synchronous
IO-bound
CPU-bound
Unstructured network code
Answer: 2)IO-bound
4.asyncio does not scale well.
True
False
Answer: 2)False
5.Which module can be used to implement parallelism in Python3?
await
threading
multiprocessing
asyncio
Answer: 3)multiprocessing
6.Asynchronous programs are always faster.
False
True
Answer: 1)False
7.In purely concurrent programs, only one CPU core is used.
False
True
Answer: 2)True
8.Which module can be used to implement asynchronous communication in Python3?
await
threading
multiprocessing
asyncio
Answer: 4)asyncio
9.In apps using asyncio, who decides when a context switch can be done?
Code
Indeterminate
Random
OS
Answer: 1)Code
10.asyncio apps must have at least ________ threads of execution.
3
5
2
1
Answer: 4)1
11.In asyncio apps, when is context switching done?
Randomly
As decided by OS
Indeterminate
At points defined by code
Answer: 4)At points defined by code
12.In apps using threading, who decides when to do a context switch?
Programmer
OS
App
Random
Answer: 2)OS
13.Name the low-level module on which threading is based.
_thread
thread
_THREAD
_threading
Answer: 1)_thread
asyncio: Final Assessment
1.Name a way in which multiprocessing process can be started.
run
start()
init
spawn
Answer: 4)spawn
2.A callable object in Python must have _______ function.
invoke()
invokable()
callable()
call()
Answer: 4)call()
3.uvloop can be used as a drop-in replacement for the default event loop in asyncio.
False
True
Answer: 2)True
4.The key identifying the type of an asyncio event is ______________.
Event-cat
Event-category
Event-type
type
Answer: 2)True
5.The event loop is the heart of the asyncio app.
False
True
Answer: 2)True
6.Which among the following is not a way to schedule a coroutine for execution?
asyncio.run()
schedule()
create_task()
await
Answer: 2)schedule()
7.uvloop is a part of the standard library.
True
False
Answer: 2)False
8.For a class inheriting Thread, which method can be overridden other than the constructor?
run()
start()
init()
action()
Answer: 1)run()
9.uvloop is distributed under _______ license.
Apache
MIT
GPL
Proprietary
Answer: 2)MIT
10.Forkserver process in multiprocessing is multi-threaded.
False
True
Answer: 1)False
11.Just calling a coroutine will cause it to be executed.
False
True
Answer: 1)False
12.Which function is used to run awaitables concurrently in asyncio?
await()
async()
gather()
run()
Answer: 3)gather()
13.What is the full form of GIL?
Global Interactive Length
Global Interpreter Lock
Global Interactive Lock
Global Interpreter Low
Answer: 2)Global Interpreter Lock
14.All resources of the parent process is inherited in the fork method of starting a multiprocessing process.
True
False
Answer: 1)True
15.fork method to start a multiprocessing process works only in UNIX-based systems. True or false?
False
True
Answer: 1)False
16.Which module can be used to implement concurrency in Python 3?
asyncio
multiprocessing
threading
await
Answer: 3)threading
17.Which method is executed when the start() method of a thread object is called?
__run__()
run()
start()
init()
Answer: 2)run()
18.An asyncio future represents an eventual result.
True
False
Answer: 1)True
19.ASGI stands for ______________________.
Asynchronous Server Gate Interface
Asynchronous Serving Gate Interface
Asynchronously Serving Gateway Interface
Asynchronous Server Gateway Interface
Answer: 4)Asynchronous Server Gateway Interface
20.What is the biggest limitation of Cpython?
Asynchronous Server Gate Interface
Threads
GIL
Subprocesses
Answer: 3)GIL
21.Name the default method to start a multiprocessing process in Linux.
spawn
init
forkserver
fork
Answer: 4)fork
22.Ideally, how many times should asyncio.run() be called?
shouldn’t be called.
two
one
three
Answer: 3)one
23.set_start_method() can be called more than once in the same program.
True
False
Answer: 2)False
24.WSGI also supports asynchronous apps.
True
False
Answer: 2)False
25.Name the method of starting a multiprocessing process which is not available in UNIX-based systems.
Forkserver
Spawn
All the options
Fork
Answer: 2)Spawn
26.Which is the method used to change the default way to create child processes in multiprocessing?
start_method()
set_method()
reset_start_method()
set_start_method()
Answer: 4)set_start_method()
27.uvloop will also work on Python 2.0
True
False
28.ASGI is a specification.
True
False
Answer: 1)True
29.Name the reference implementation of Python.
IronPython
Jpython
Jython
Cpython
Answer: 4)Cpython
30.ASGI also supports WSGI apps.
False
True
Answer: 2)True
31.Name the default method to start a multiprocessing process in Windows.
fork
spawn
init()
forkserver
Answer: 2)spawn
32.asyncio coroutines are declared using _______.
decorator
def
async/await
function
Answer: 3)async/await
33.In ________ method, a server is created to start a multiprocessing process.
Fork
Spawnserver
Spawn
Forkserver
Answer: 4)Forkserver
34.Uvicorn is an implementation of ASGI.
False
True
Answer: 2)True
35.Events are being sent as _________.
Arrays
Dictionaries
Lists
Tuples
Answer: 2)Dictionaries
36.WSGI apps can also run ASGI apps.
True
False
Answer: 2)False
If you want answers to any of the fresco play courses feel free to ask in the comment section, we will surely help.
No comments