<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Madanswer Technologies Interview Questions Data|Agile|DevOPs|Python - Recent questions and answers in Celery</title>
<link>https://madanswer.com/qa/celery</link>
<description>Powered by Question2Answer</description>
<item>
<title>Answered: The GroupResult takes a list of AsyncResult instances and has the following operations.</title>
<link>https://madanswer.com/61863/the-groupresult-takes-list-asyncresult-instances-and-has-the-following-operations?show=61864#a61864</link>
<description>
&lt;p&gt;e) All the options&lt;/p&gt;&lt;div&gt;&lt;/div&gt;
</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61863/the-groupresult-takes-list-asyncresult-instances-and-has-the-following-operations?show=61864#a61864</guid>
<pubDate>Sun, 19 Jun 2022 04:45:07 +0000</pubDate>
</item>
<item>
<title>Answered: (group(add.s(i, i) for i in xrange(10)) | xsum.s())().get() is an example of</title>
<link>https://madanswer.com/61861/group-add-s-i-i-for-i-in-xrange-10-xsum-s-get-is-an-example-of?show=61862#a61862</link>
<description>a) chain</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61861/group-add-s-i-i-for-i-in-xrange-10-xsum-s-get-is-an-example-of?show=61862#a61862</guid>
<pubDate>Sun, 19 Jun 2022 04:44:41 +0000</pubDate>
</item>
<item>
<title>Answered: Map and star-map differ from group in what ways?</title>
<link>https://madanswer.com/61859/map-and-star-map-differ-from-group-in-what-ways?show=61860#a61860</link>
<description>b) only one task message is sent AND the operation is sequential</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61859/map-and-star-map-differ-from-group-in-what-ways?show=61860#a61860</guid>
<pubDate>Sun, 19 Jun 2022 04:44:14 +0000</pubDate>
</item>
<item>
<title>Answered: Consider a chain  res = chain(add.s(4, 4), mul.s(8), mul.s(10))()  where add is defined as a+b and mul is defined as a*b. How can we get intermediate parent results</title>
<link>https://madanswer.com/61857/consider-chain-res-chain-add-mul-where-defined-defined-intermediate-parent-results?show=61858#a61858</link>
<description>
&lt;p&gt;c) res.parent.parent.get()&lt;/p&gt;&lt;div&gt;&lt;/div&gt;
</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61857/consider-chain-res-chain-add-mul-where-defined-defined-intermediate-parent-results?show=61858#a61858</guid>
<pubDate>Sun, 19 Jun 2022 04:43:48 +0000</pubDate>
</item>
<item>
<title>Answered: To divide an iterable work into pieces, use</title>
<link>https://madanswer.com/61855/to-divide-an-iterable-work-into-pieces-use?show=61856#a61856</link>
<description>b) chunks</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61855/to-divide-an-iterable-work-into-pieces-use?show=61856#a61856</guid>
<pubDate>Sun, 19 Jun 2022 04:43:14 +0000</pubDate>
</item>
<item>
<title>Answered: Let  i = app.control.inspect() To get a list of reserved tasks, use</title>
<link>https://madanswer.com/61853/let-i-app-control-inspect-to-get-a-list-of-reserved-tasks-use?show=61854#a61854</link>
<description>a) i.reserved()</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61853/let-i-app-control-inspect-to-get-a-list-of-reserved-tasks-use?show=61854#a61854</guid>
<pubDate>Sun, 19 Jun 2022 04:42:51 +0000</pubDate>
</item>
<item>
<title>Answered: To add a consumer to a queue named q1, use</title>
<link>https://madanswer.com/61851/to-add-a-consumer-to-a-queue-named-q1-use?show=61852#a61852</link>
<description>a) app.control.add_consumer(‘q1’, reply=True)</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61851/to-add-a-consumer-to-a-queue-named-q1-use?show=61852#a61852</guid>
<pubDate>Sun, 19 Jun 2022 04:42:22 +0000</pubDate>
</item>
<item>
<title>Answered: Let  i = app.control.inspect() To get a list of registered tasks, use</title>
<link>https://madanswer.com/61849/let-i-app-control-inspect-to-get-a-list-of-registered-tasks-use?show=61850#a61850</link>
<description>a) i.registered()</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61849/let-i-app-control-inspect-to-get-a-list-of-registered-tasks-use?show=61850#a61850</guid>
<pubDate>Sun, 19 Jun 2022 04:41:53 +0000</pubDate>
</item>
<item>
<title>Answered: What is the default queue in celery</title>
<link>https://madanswer.com/61847/what-is-the-default-queue-in-celery?show=61848#a61848</link>
<description>d) celery</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61847/what-is-the-default-queue-in-celery?show=61848#a61848</guid>
<pubDate>Sun, 19 Jun 2022 04:41:27 +0000</pubDate>
</item>
<item>
<title>Answered: To list active queues for the worker w1, use</title>
<link>https://madanswer.com/61845/to-list-active-queues-for-the-worker-w1-use?show=61846#a61846</link>
<description>
&lt;p&gt;b) app.control.inspect([&amp;lsquo;w1.local&amp;rsquo;]).active_queues()&lt;/p&gt;&lt;div&gt;&lt;/div&gt;
</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61845/to-list-active-queues-for-the-worker-w1-use?show=61846#a61846</guid>
<pubDate>Sun, 19 Jun 2022 04:41:03 +0000</pubDate>
</item>
<item>
<title>Answered: consider a task T. Write a code to execute in 30 seconds from now, but expires after 3 minutes.</title>
<link>https://madanswer.com/61843/consider-task-write-code-to-execute-in-30-seconds-from-now-but-expires-after-minutes?show=61844#a61844</link>
<description>a) T.apply_async(countdown=30, expires=180)</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61843/consider-task-write-code-to-execute-in-30-seconds-from-now-but-expires-after-minutes?show=61844#a61844</guid>
<pubDate>Sun, 19 Jun 2022 04:40:40 +0000</pubDate>
</item>
<item>
<title>Answered: If we add the following in celery configuration</title>
<link>https://madanswer.com/61841/if-we-add-the-following-in-celery-configuration?show=61842#a61842</link>
<description>d) All the options</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61841/if-we-add-the-following-in-celery-configuration?show=61842#a61842</guid>
<pubDate>Sun, 19 Jun 2022 04:40:00 +0000</pubDate>
</item>
<item>
<title>Answered: celeri multi stores information about workers.</title>
<link>https://madanswer.com/61839/celeri-multi-stores-information-about-workers?show=61840#a61840</link>
<description>b) False</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61839/celeri-multi-stores-information-about-workers?show=61840#a61840</guid>
<pubDate>Sun, 19 Jun 2022 04:39:36 +0000</pubDate>
</item>
<item>
<title>Answered: Celery automatically retries sending messages in the event of a connection failure.</title>
<link>https://madanswer.com/61837/celery-automatically-retries-sending-messages-in-the-event-of-connection-failure?show=61838#a61838</link>
<description>a) True</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61837/celery-automatically-retries-sending-messages-in-the-event-of-connection-failure?show=61838#a61838</guid>
<pubDate>Sun, 19 Jun 2022 04:39:13 +0000</pubDate>
</item>
<item>
<title>Answered: Consider a file tasks.py with:</title>
<link>https://madanswer.com/61835/consider-a-file-tasks-py-with?show=61836#a61836</link>
<description>
&lt;p&gt;b) tasks.add&amp;rsquo;&lt;/p&gt;&lt;div&gt;&lt;/div&gt;
</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61835/consider-a-file-tasks-py-with?show=61836#a61836</guid>
<pubDate>Sun, 19 Jun 2022 04:38:50 +0000</pubDate>
</item>
<item>
<title>Answered: Consider a task T. Write the code to execute in 10 seconds from now, specified using ETA.</title>
<link>https://madanswer.com/61833/consider-a-task-t-write-the-code-to-execute-in-10-seconds-from-now-specified-using-eta?show=61834#a61834</link>
<description>a) T.apply_async(ETA=now + timedelta(seconds=10))</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61833/consider-a-task-t-write-the-code-to-execute-in-10-seconds-from-now-specified-using-eta?show=61834#a61834</guid>
<pubDate>Sun, 19 Jun 2022 04:38:24 +0000</pubDate>
</item>
<item>
<title>Answered: Celery has the following defined default result states, except _______.</title>
<link>https://madanswer.com/61831/celery-has-the-following-defined-default-result-states-except-_______?show=61832#a61832</link>
<description>b) RUNNING</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61831/celery-has-the-following-defined-default-result-states-except-_______?show=61832#a61832</guid>
<pubDate>Sun, 19 Jun 2022 04:37:54 +0000</pubDate>
</item>
<item>
<title>Answered: Consider the following.</title>
<link>https://madanswer.com/61829/consider-the-following?show=61830#a61830</link>
<description>
&lt;p&gt;a) Memory address of the object&lt;/p&gt;&lt;div&gt;&lt;/div&gt;
</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61829/consider-the-following?show=61830#a61830</guid>
<pubDate>Sun, 19 Jun 2022 04:37:18 +0000</pubDate>
</item>
<item>
<title>Answered: Which of the following calling APIs is/are supported by celery task instances?</title>
<link>https://madanswer.com/61827/which-of-the-following-calling-apis-is-are-supported-by-celery-task-instances?show=61828#a61828</link>
<description>d) All the options</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61827/which-of-the-following-calling-apis-is-are-supported-by-celery-task-instances?show=61828#a61828</guid>
<pubDate>Sun, 19 Jun 2022 04:36:50 +0000</pubDate>
</item>
<item>
<title>Answered: If the following configuration is used, which of the following is used for broker and backend?</title>
<link>https://madanswer.com/61825/if-the-following-configuration-used-which-the-following-used-for-broker-and-backend?show=61826#a61826</link>
<description>b) Both broker and backend are RabbitMQ</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61825/if-the-following-configuration-used-which-the-following-used-for-broker-and-backend?show=61826#a61826</guid>
<pubDate>Sun, 19 Jun 2022 04:36:24 +0000</pubDate>
</item>
<item>
<title>Answered: If a task raises an exception, we can override it using __________.</title>
<link>https://madanswer.com/61823/if-a-task-raises-an-exception-we-can-override-it-using-__________?show=61824#a61824</link>
<description>b) result.get(propagate=False)</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61823/if-a-task-raises-an-exception-we-can-override-it-using-__________?show=61824#a61824</guid>
<pubDate>Sun, 19 Jun 2022 04:35:53 +0000</pubDate>
</item>
<item>
<title>Answered: If app=celery(), task is created using _______ decorator.</title>
<link>https://madanswer.com/61821/if-app-celery-task-is-created-using-_______-decorator?show=61822#a61822</link>
<description>b) @app.task</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61821/if-app-celery-task-is-created-using-_______-decorator?show=61822#a61822</guid>
<pubDate>Sun, 19 Jun 2022 04:35:22 +0000</pubDate>
</item>
<item>
<title>Answered: Name the broker in the following.</title>
<link>https://madanswer.com/61819/name-the-broker-in-the-following?show=61820#a61820</link>
<description>b) RabbitMQ</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61819/name-the-broker-in-the-following?show=61820#a61820</guid>
<pubDate>Sun, 19 Jun 2022 04:35:01 +0000</pubDate>
</item>
<item>
<title>Answered: Using rpc:// result backend, two processes can wait for the same result.</title>
<link>https://madanswer.com/61817/using-rpc-result-backend-two-processes-can-wait-for-the-same-result?show=61818#a61818</link>
<description>b) False</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61817/using-rpc-result-backend-two-processes-can-wait-for-the-same-result?show=61818#a61818</guid>
<pubDate>Sun, 19 Jun 2022 04:34:37 +0000</pubDate>
</item>
<item>
<title>Answered: Celery protocol can be implemented in any language.</title>
<link>https://madanswer.com/61815/celery-protocol-can-be-implemented-in-any-language?show=61816#a61816</link>
<description>a) True</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61815/celery-protocol-can-be-implemented-in-any-language?show=61816#a61816</guid>
<pubDate>Sun, 19 Jun 2022 04:34:12 +0000</pubDate>
</item>
<item>
<title>Answered: A client process ___________.</title>
<link>https://madanswer.com/61813/a-client-process-___________?show=61814#a61814</link>
<description>
&lt;p&gt;c) puts work requests into queues and fetches results from the backend&lt;/p&gt;&lt;div&gt;&lt;/div&gt;
</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61813/a-client-process-___________?show=61814#a61814</guid>
<pubDate>Sun, 19 Jun 2022 04:33:48 +0000</pubDate>
</item>
<item>
<title>Answered: To run RabbitMQ in the background, use ________.</title>
<link>https://madanswer.com/61811/to-run-rabbitmq-in-the-background-use-________?show=61812#a61812</link>
<description>c) $ sudo rabbitmq-server -detached</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61811/to-run-rabbitmq-in-the-background-use-________?show=61812#a61812</guid>
<pubDate>Sun, 19 Jun 2022 04:33:24 +0000</pubDate>
</item>
<item>
<title>Answered: Celery is a package available in __________.</title>
<link>https://madanswer.com/61809/celery-is-a-package-available-in-__________?show=61810#a61810</link>
<description>c) PyPI&lt;br /&gt;
&lt;br /&gt;
Celery is a package available in PyPI</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61809/celery-is-a-package-available-in-__________?show=61810#a61810</guid>
<pubDate>Sun, 19 Jun 2022 04:32:58 +0000</pubDate>
</item>
<item>
<title>Answered: Celery Interview Multiple Choice Questions and Answers with Explanation</title>
<link>https://madanswer.com/61682/celery-interview-multiple-choice-questions-and-answers-with-explanation?show=61683#a61683</link>
<description>Question#1 Celery is a package available in __________.&lt;br /&gt;
&lt;br /&gt;
a) Pandas&lt;br /&gt;
&lt;br /&gt;
b) NumPy&lt;br /&gt;
&lt;br /&gt;
c) PyPI&lt;br /&gt;
&lt;br /&gt;
d) SciPy&lt;br /&gt;
&lt;br /&gt;
Answer:- PyPI&lt;br /&gt;
&lt;br /&gt;
Question#2 To run RabbitMQ in the background, use ________.&lt;br /&gt;
&lt;br /&gt;
a) $ sudo rabbitmq-server -background&lt;br /&gt;
&lt;br /&gt;
b) $ sudo rabbitmq-server -b&lt;br /&gt;
&lt;br /&gt;
c) $ sudo rabbitmq-server -detached&lt;br /&gt;
&lt;br /&gt;
d) $ sudo rabbitmq-server -attach&lt;br /&gt;
&lt;br /&gt;
Answer:- $ sudo rabbitmq-server -detached&lt;br /&gt;
&lt;br /&gt;
Question#3 A client process ___________.&lt;br /&gt;
&lt;br /&gt;
a) subscribes to task queues to perform work&lt;br /&gt;
&lt;br /&gt;
b) puts work requests into queues&lt;br /&gt;
&lt;br /&gt;
c) puts work requests into queues and fetches results from the backend&lt;br /&gt;
&lt;br /&gt;
d) fetches results from the backend&lt;br /&gt;
&lt;br /&gt;
e) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- puts work requests into queues and fetches results from the backend&lt;br /&gt;
&lt;br /&gt;
Question#4 Celery protocol can be implemented in any language.&lt;br /&gt;
&lt;br /&gt;
a) True&lt;br /&gt;
&lt;br /&gt;
b) False&lt;br /&gt;
&lt;br /&gt;
Answer:- True&lt;br /&gt;
&lt;br /&gt;
Question#5 Using rpc:// result backend, two processes can wait for the same result.&lt;br /&gt;
&lt;br /&gt;
a) True&lt;br /&gt;
&lt;br /&gt;
b) False&lt;br /&gt;
&lt;br /&gt;
Answer:- False&lt;br /&gt;
&lt;br /&gt;
Question#6 Name the broker in the following.&lt;br /&gt;
&lt;br /&gt;
app = Celery(‘tasks’, broker=’pyamqp://guest@localhost//’).&lt;br /&gt;
&lt;br /&gt;
a) Redis&lt;br /&gt;
&lt;br /&gt;
b) RabbitMQ&lt;br /&gt;
&lt;br /&gt;
c) Amazon SQS&lt;br /&gt;
&lt;br /&gt;
d) None of the options&lt;br /&gt;
&lt;br /&gt;
Answer:- RabbitMQ&lt;br /&gt;
&lt;br /&gt;
Question#7 If app=celery(), task is created using _______ decorator.&lt;br /&gt;
&lt;br /&gt;
a) app&lt;br /&gt;
&lt;br /&gt;
b) @app.task&lt;br /&gt;
&lt;br /&gt;
c) @task.app&lt;br /&gt;
&lt;br /&gt;
d) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- @app.task&lt;br /&gt;
&lt;br /&gt;
Question#8 If a task raises an exception, we can override it using __________.&lt;br /&gt;
&lt;br /&gt;
a) result.get(propagate=True)&lt;br /&gt;
&lt;br /&gt;
b) result.get(propagate=False)&lt;br /&gt;
&lt;br /&gt;
c) result.get(exception=True)&lt;br /&gt;
&lt;br /&gt;
d) result.get(exception=False)&lt;br /&gt;
&lt;br /&gt;
Answer:- result.get(propagate=False)&lt;br /&gt;
&lt;br /&gt;
Question#9 If the following configuration is used, which of the following is used for broker and backend?&lt;br /&gt;
&lt;br /&gt;
broker_url = ‘pyamqp://’&lt;br /&gt;
&lt;br /&gt;
result_backend = ‘rpc://’.&lt;br /&gt;
&lt;br /&gt;
a) Broker is Redis, backend is RabbitMQ&lt;br /&gt;
&lt;br /&gt;
b) Both broker and backend are RabbitMQ&lt;br /&gt;
&lt;br /&gt;
c) Both broker and backend are Redis&lt;br /&gt;
&lt;br /&gt;
d) Broker is RabbitMQ, backend is Redis&lt;br /&gt;
&lt;br /&gt;
Answer:- Both broker and backend are RabbitMQ&lt;br /&gt;
&lt;br /&gt;
Question#10 Which of the following calling APIs is/are supported by celery task instances?&lt;br /&gt;
&lt;br /&gt;
a) calling&lt;br /&gt;
&lt;br /&gt;
b) delay&lt;br /&gt;
&lt;br /&gt;
c) apply_async&lt;br /&gt;
&lt;br /&gt;
d) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- All the options&lt;br /&gt;
&lt;br /&gt;
Question#11 Consider the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;&amp;lt;&amp;lt; from celery import Celery&lt;br /&gt;
&lt;br /&gt;
&amp;lt;&amp;lt;&amp;lt; app = Celery()&lt;br /&gt;
&lt;br /&gt;
What does app have?&lt;br /&gt;
&lt;br /&gt;
a) Memory address of the object&lt;br /&gt;
&lt;br /&gt;
b) Name of the current main module&lt;br /&gt;
&lt;br /&gt;
c) Name of the app class&lt;br /&gt;
&lt;br /&gt;
d) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- Memory address of the object&lt;br /&gt;
&lt;br /&gt;
Question#12 Celery has the following defined default result states, except _______.&lt;br /&gt;
&lt;br /&gt;
a) STARTED&lt;br /&gt;
&lt;br /&gt;
b) RUNNING&lt;br /&gt;
&lt;br /&gt;
c) PENDING&lt;br /&gt;
&lt;br /&gt;
d) RETRY&lt;br /&gt;
&lt;br /&gt;
Answer:- RUNNING&lt;br /&gt;
&lt;br /&gt;
Question#13 Consider a task T. Write the code to execute in 10 seconds from now, specified using ETA.&lt;br /&gt;
&lt;br /&gt;
a) T.apply_async(ETA=now + timedelta(seconds=10))&lt;br /&gt;
&lt;br /&gt;
b) T.apply_async(ETA=now + timedelta(10))&lt;br /&gt;
&lt;br /&gt;
c) T.apply_async(eta=now + timedelta(seconds=10))&lt;br /&gt;
&lt;br /&gt;
d) T.apply_async(countdown=10)&lt;br /&gt;
&lt;br /&gt;
Answer:- T.apply_async(ETA=now + timedelta(seconds=10))&lt;br /&gt;
&lt;br /&gt;
Question#14 Consider a file tasks.py with:&lt;br /&gt;
&lt;br /&gt;
@app.task&lt;br /&gt;
&lt;br /&gt;
def add(x, y):&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;return x + y&lt;br /&gt;
&lt;br /&gt;
After executing:&lt;br /&gt;
&lt;br /&gt;
from tasks import add&lt;br /&gt;
&lt;br /&gt;
What will be the output of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;&amp;lt;&amp;lt; add.name&lt;br /&gt;
&lt;br /&gt;
a) error&lt;br /&gt;
&lt;br /&gt;
b) tasks.add’&lt;br /&gt;
&lt;br /&gt;
c) name not defined&lt;br /&gt;
&lt;br /&gt;
d) None of the options&lt;br /&gt;
&lt;br /&gt;
Answer:- tasks.add’&lt;br /&gt;
&lt;br /&gt;
Question#15 Celery automatically retries sending messages in the event of a connection failure.&lt;br /&gt;
&lt;br /&gt;
a) True&lt;br /&gt;
&lt;br /&gt;
b) False&lt;br /&gt;
&lt;br /&gt;
Answer:- True&lt;br /&gt;
&lt;br /&gt;
Question#16 celeri multi stores information about workers.&lt;br /&gt;
&lt;br /&gt;
a) True&lt;br /&gt;
&lt;br /&gt;
b) False&lt;br /&gt;
&lt;br /&gt;
Answer:- False&lt;br /&gt;
&lt;br /&gt;
Question#17 If we add the following in celery configuration&lt;br /&gt;
&lt;br /&gt;
task_annotations = {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;‘tasks.add’: {‘rate_limit’: ’10/m’}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
what does it mean&lt;br /&gt;
&lt;br /&gt;
a) mechanism to low prioritize misbehaving queues&lt;br /&gt;
&lt;br /&gt;
b) the task rate limit is set&lt;br /&gt;
&lt;br /&gt;
c) Only 10 tasks of this type can be processed in a minute&lt;br /&gt;
&lt;br /&gt;
d) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- All the options&lt;br /&gt;
&lt;br /&gt;
Question#18 consider a task T. Write a code to execute in 30 seconds from now, but expires after 3 minutes.&lt;br /&gt;
&lt;br /&gt;
a) T.apply_async(countdown=30, expires=180)&lt;br /&gt;
&lt;br /&gt;
b) T.apply_async(countdown=30, expires=3min)&lt;br /&gt;
&lt;br /&gt;
c) T.apply_async(timedelta(seconds=30), expires=180)&lt;br /&gt;
&lt;br /&gt;
d) T.apply_async(countdown=180, expires=30)&lt;br /&gt;
&lt;br /&gt;
Answer:- T.apply_async(countdown=30, expires=180)&lt;br /&gt;
&lt;br /&gt;
Question#19 To list active queues for the worker w1, use&lt;br /&gt;
&lt;br /&gt;
a) app.control.inspect().active_queues()&lt;br /&gt;
&lt;br /&gt;
b) app.control.inspect([‘w1.local’]).active_queues()&lt;br /&gt;
&lt;br /&gt;
c) both&lt;br /&gt;
&lt;br /&gt;
d) None&lt;br /&gt;
&lt;br /&gt;
Answer:- app.control.inspect([‘w1.local’]).active_queues()&lt;br /&gt;
&lt;br /&gt;
Question#20 What is the default queue in celery&lt;br /&gt;
&lt;br /&gt;
a) Redis&lt;br /&gt;
&lt;br /&gt;
b) default&lt;br /&gt;
&lt;br /&gt;
c) RabbitMQ&lt;br /&gt;
&lt;br /&gt;
d) celery&lt;br /&gt;
&lt;br /&gt;
Answer:- celery&lt;br /&gt;
&lt;br /&gt;
Question#21 Let&lt;br /&gt;
&lt;br /&gt;
i = app.control.inspect()&lt;br /&gt;
&lt;br /&gt;
To get a list of registered tasks, use&lt;br /&gt;
&lt;br /&gt;
a) i.registered()&lt;br /&gt;
&lt;br /&gt;
b) i.active()&lt;br /&gt;
&lt;br /&gt;
c) i.scheduled()&lt;br /&gt;
&lt;br /&gt;
d) i.reserved()&lt;br /&gt;
&lt;br /&gt;
e) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- i.registered()&lt;br /&gt;
&lt;br /&gt;
Question#22 To add a consumer to a queue named q1, use&lt;br /&gt;
&lt;br /&gt;
a) app.control.add_consumer(‘q1’, reply=True)&lt;br /&gt;
&lt;br /&gt;
b) app.control.add_consumer(‘q1’, reply=False)&lt;br /&gt;
&lt;br /&gt;
c) app.control.add_consumer(‘q1’, reply=True, destination=[‘worker1@gmail.com’])&lt;br /&gt;
&lt;br /&gt;
d) app.control.add_consumer(‘q1’, reply=False, destination=[‘worker1@gmail.com’])&lt;br /&gt;
&lt;br /&gt;
Answer:- app.control.add_consumer(‘q1’, reply=True)&lt;br /&gt;
&lt;br /&gt;
Question#23 Let&lt;br /&gt;
&lt;br /&gt;
i = app.control.inspect()&lt;br /&gt;
&lt;br /&gt;
To get a list of reserved tasks, use&lt;br /&gt;
&lt;br /&gt;
a) i.reserved()&lt;br /&gt;
&lt;br /&gt;
b) i.registered()&lt;br /&gt;
&lt;br /&gt;
c) i.scheduled()&lt;br /&gt;
&lt;br /&gt;
d) i.active()&lt;br /&gt;
&lt;br /&gt;
Answer:- i.reserved()&lt;br /&gt;
&lt;br /&gt;
Question#24 To divide an iterable work into pieces, use&lt;br /&gt;
&lt;br /&gt;
a) starmap&lt;br /&gt;
&lt;br /&gt;
b) chunks&lt;br /&gt;
&lt;br /&gt;
c) piece&lt;br /&gt;
&lt;br /&gt;
d) chord&lt;br /&gt;
&lt;br /&gt;
Answer:- chunks&lt;br /&gt;
&lt;br /&gt;
Question#25 Consider a chain&lt;br /&gt;
&lt;br /&gt;
res = chain(add.s(4, 4), mul.s(8), mul.s(10))()&lt;br /&gt;
&lt;br /&gt;
where add is defined as a+b and mul is defined as a*b. How can we get intermediate parent results&lt;br /&gt;
&lt;br /&gt;
a) res.parent.parent&lt;br /&gt;
&lt;br /&gt;
b) res.parent.get()&lt;br /&gt;
&lt;br /&gt;
c) res.parent.parent.get()&lt;br /&gt;
&lt;br /&gt;
d) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- res.parent.parent.get()&lt;br /&gt;
&lt;br /&gt;
Question#26 Map and star-map differ from group in what ways?&lt;br /&gt;
&lt;br /&gt;
a) the operation is parallel&lt;br /&gt;
&lt;br /&gt;
b) only one task message is sent AND the operation is sequential&lt;br /&gt;
&lt;br /&gt;
c) only one task message is sent AND the operation is parallel&lt;br /&gt;
&lt;br /&gt;
d) the operation is sequential&lt;br /&gt;
&lt;br /&gt;
e) only one task message is sent&lt;br /&gt;
&lt;br /&gt;
Answer:- only one task message is sent AND the operation is sequential&lt;br /&gt;
&lt;br /&gt;
Question#27 (group(add.s(i, i) for i in xrange(10)) | xsum.s())().get() is an example of&lt;br /&gt;
&lt;br /&gt;
a) chain&lt;br /&gt;
&lt;br /&gt;
b) group&lt;br /&gt;
&lt;br /&gt;
c) chunk&lt;br /&gt;
&lt;br /&gt;
d) chord&lt;br /&gt;
&lt;br /&gt;
Answer:- chain&lt;br /&gt;
&lt;br /&gt;
Question#28 The GroupResult takes a list of AsyncResult instances and has the following operations.&lt;br /&gt;
&lt;br /&gt;
a) join()&lt;br /&gt;
&lt;br /&gt;
b) revoke()&lt;br /&gt;
&lt;br /&gt;
c) ready()&lt;br /&gt;
&lt;br /&gt;
d) successful()&lt;br /&gt;
&lt;br /&gt;
e) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- All the options&lt;br /&gt;
&lt;br /&gt;
Celery Interview Question-Answer Part – 2&lt;br /&gt;
&lt;br /&gt;
Write a Commenton Celery Interview Question-Answer Part – 2&lt;br /&gt;
&lt;br /&gt;
Question#1 consider&lt;br /&gt;
&lt;br /&gt;
@app.task&lt;br /&gt;
&lt;br /&gt;
def xsum(numbers):&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;return sum(numbers)&lt;br /&gt;
&lt;br /&gt;
What is the map equivalent of&lt;br /&gt;
&lt;br /&gt;
@app.task&lt;br /&gt;
&lt;br /&gt;
def&lt;br /&gt;
&lt;br /&gt;
temp():&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;return [xsum(range(10)), xsum(range(100))]&lt;br /&gt;
&lt;br /&gt;
Assume all needed methods are imported&lt;br /&gt;
&lt;br /&gt;
a) ~xsum.map([range(100), range(100)])&lt;br /&gt;
&lt;br /&gt;
b) ~xsum.map([range(100), range(10)])&lt;br /&gt;
&lt;br /&gt;
c) ~xsum.map([range(10), range(100)])&lt;br /&gt;
&lt;br /&gt;
d) ~xsum.map([range(10), range(10)])&lt;br /&gt;
&lt;br /&gt;
Answer:- ~xsum.map([range(10), range(100)])&lt;br /&gt;
&lt;br /&gt;
Question#2 consider a method&lt;br /&gt;
&lt;br /&gt;
def add(a,b):&lt;br /&gt;
&lt;br /&gt;
return a + b&lt;br /&gt;
&lt;br /&gt;
What is a partial signature?&lt;br /&gt;
&lt;br /&gt;
a) s2 = add.s(2)&lt;br /&gt;
&lt;br /&gt;
b) s2 = sum.s(2, 3)&lt;br /&gt;
&lt;br /&gt;
c) s2 = add.s(2, 3)&lt;br /&gt;
&lt;br /&gt;
d) s2 = sum.s(2)&lt;br /&gt;
&lt;br /&gt;
Answer:- s2 = sum.s(2, 3)&lt;br /&gt;
&lt;br /&gt;
Question#3 Consider a chain&lt;br /&gt;
&lt;br /&gt;
res = chain(add.s(4, 4), mul.s(8), mul.s(10))()&lt;br /&gt;
&lt;br /&gt;
where add is defined as a+b and mul is defined as a*b. How can we get intermediate parent results&lt;br /&gt;
&lt;br /&gt;
a) res.parent.parent.get()&lt;br /&gt;
&lt;br /&gt;
b) res.parent.get()&lt;br /&gt;
&lt;br /&gt;
c) res.parent.parent&lt;br /&gt;
&lt;br /&gt;
d) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- res.parent.get()&lt;br /&gt;
&lt;br /&gt;
Question#4 To ensure a job runs every 15 mins using crontab(), what should be given?&lt;br /&gt;
&lt;br /&gt;
a) crontab(minute=’15’)&lt;br /&gt;
&lt;br /&gt;
b) crontab(minute=’15,30,45′)&lt;br /&gt;
&lt;br /&gt;
c) crontab(minute=’*/15′)&lt;br /&gt;
&lt;br /&gt;
d) crontab(minute=’15,30,45′) AND crontab(minute=’15’)&lt;br /&gt;
&lt;br /&gt;
Answer:- crontab(minute=’*/15′)&lt;br /&gt;
&lt;br /&gt;
Question#5 When using solar scheduling, what is sunrise event?&lt;br /&gt;
&lt;br /&gt;
a) Execute when the upper edge of the sun appears over the eastern horizon in the morning.&lt;br /&gt;
&lt;br /&gt;
b) Execute at the moment after which the sky is no longer completely dark. This is when the sun is 18 degrees below the horizon.&lt;br /&gt;
&lt;br /&gt;
c) Execute when there’s enough sunlight for the horizon and some objects to be distinguishable; formally, when the sun is 12 degrees below the horizon.&lt;br /&gt;
&lt;br /&gt;
d) Execute when there’s enough light for objects to be distinguishable so that outdoor activities can commence; formally, when the Sun is 6 degrees below the horizon.&lt;br /&gt;
&lt;br /&gt;
Answer:- Execute when the upper edge of the sun appears over the eastern horizon in the morning.&lt;br /&gt;
&lt;br /&gt;
Question#6 Solar events are&lt;br /&gt;
&lt;br /&gt;
a) sunset&lt;br /&gt;
&lt;br /&gt;
b) sunrise&lt;br /&gt;
&lt;br /&gt;
c) dawn&lt;br /&gt;
&lt;br /&gt;
d) dusk&lt;br /&gt;
&lt;br /&gt;
e) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- All the options&lt;br /&gt;
&lt;br /&gt;
Question#7 To start celery beat service using a custom file is achieved using&lt;br /&gt;
&lt;br /&gt;
a) celery -A proj beat /home/celery/var/run/celerybeat-schedule&lt;br /&gt;
&lt;br /&gt;
b) celery -A proj beat -s /home/celery/var/run/celerybeat-schedule&lt;br /&gt;
&lt;br /&gt;
c) celery -A proj beat -file /home/celery/var/run/celerybeat-schedule&lt;br /&gt;
&lt;br /&gt;
d) celery -A proj beat -f /home/celery/var/run/celerybeat-schedule&lt;br /&gt;
&lt;br /&gt;
Answer:- celery -A proj beat -s /home/celery/var/run/celerybeat-schedule&lt;br /&gt;
&lt;br /&gt;
Question#8 What does the command do&lt;br /&gt;
&lt;br /&gt;
$ celery -A proj inspect query_task id1 id2 … idN&lt;br /&gt;
&lt;br /&gt;
a) show the corresponding queues&lt;br /&gt;
&lt;br /&gt;
b) show the task status of id1 id2 … idN&lt;br /&gt;
&lt;br /&gt;
c) show the workers for the corresponding tasks&lt;br /&gt;
&lt;br /&gt;
d) query information about multiple tasks&lt;br /&gt;
&lt;br /&gt;
Answer:- query information about multiple tasks&lt;br /&gt;
&lt;br /&gt;
Question#9 Worker-hearbeat events are sent every&lt;br /&gt;
&lt;br /&gt;
a) 2 min&lt;br /&gt;
&lt;br /&gt;
b) 1 min&lt;br /&gt;
&lt;br /&gt;
c) 4 min&lt;br /&gt;
&lt;br /&gt;
d) 3 min&lt;br /&gt;
&lt;br /&gt;
Answer:- 1 min&lt;br /&gt;
&lt;br /&gt;
Question#10 Following command gives&lt;br /&gt;
&lt;br /&gt;
$ rabbitmqctl list_queues name memory&lt;br /&gt;
&lt;br /&gt;
a) command not found error&lt;br /&gt;
&lt;br /&gt;
b) amount of memory allocated to queue&lt;br /&gt;
&lt;br /&gt;
c) command options incorrect error&lt;br /&gt;
&lt;br /&gt;
d) number of workers currently consuming from a queue named memory&lt;br /&gt;
&lt;br /&gt;
Answer:- command not found error&lt;br /&gt;
&lt;br /&gt;
Question#11 Django database scheduler can detect timezone changes and automatically reset schedule.&lt;br /&gt;
&lt;br /&gt;
a) True&lt;br /&gt;
&lt;br /&gt;
b) False&lt;br /&gt;
&lt;br /&gt;
Answer:- False&lt;br /&gt;
&lt;br /&gt;
Question#12 What does the command do&lt;br /&gt;
&lt;br /&gt;
$ celery -A proj purge -X celery&lt;br /&gt;
&lt;br /&gt;
a) Purge messages from the celery queue&lt;br /&gt;
&lt;br /&gt;
b) Purge messages from all configured task queues&lt;br /&gt;
&lt;br /&gt;
c) Purge messages from all queues other than celery queue&lt;br /&gt;
&lt;br /&gt;
d) None of the options&lt;br /&gt;
&lt;br /&gt;
Answer:- Purge messages from all queues other than celery queue&lt;br /&gt;
&lt;br /&gt;
Question#13 To process events in real time you need&lt;br /&gt;
&lt;br /&gt;
a) State&lt;br /&gt;
&lt;br /&gt;
b) A set of handlers&lt;br /&gt;
&lt;br /&gt;
c) An event consumer&lt;br /&gt;
&lt;br /&gt;
d) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- All the options&lt;br /&gt;
&lt;br /&gt;
Question#14 What dependencies does celery have?&lt;br /&gt;
&lt;br /&gt;
a) billiard&lt;br /&gt;
&lt;br /&gt;
b) pytz&lt;br /&gt;
&lt;br /&gt;
c) kombu&lt;br /&gt;
&lt;br /&gt;
d) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- All the options&lt;br /&gt;
&lt;br /&gt;
Question#15 If app=celery(), task is created using _____ decorator?&lt;br /&gt;
&lt;br /&gt;
a) @task.app&lt;br /&gt;
&lt;br /&gt;
b) app&lt;br /&gt;
&lt;br /&gt;
c) @app.task&lt;br /&gt;
&lt;br /&gt;
d) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- @app.task&lt;br /&gt;
&lt;br /&gt;
Question#16 To configure a database backend as a result backend, the configuration is&lt;br /&gt;
&lt;br /&gt;
result_backend = ‘db+scheme://user:password@host:port/dbname’&lt;br /&gt;
&lt;br /&gt;
Which databases are supported?&lt;br /&gt;
&lt;br /&gt;
a) mysql and postgresql&lt;br /&gt;
&lt;br /&gt;
b) mysql&lt;br /&gt;
&lt;br /&gt;
c) postgresql&lt;br /&gt;
&lt;br /&gt;
d) oracle&lt;br /&gt;
&lt;br /&gt;
e) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- All the options&lt;br /&gt;
&lt;br /&gt;
Question#17 consider&lt;br /&gt;
&lt;br /&gt;
app = Celery(‘tasks’, broker=’redis://guest@localhost//’)&lt;br /&gt;
&lt;br /&gt;
Name the broker.&lt;br /&gt;
&lt;br /&gt;
a) Amazon SQS&lt;br /&gt;
&lt;br /&gt;
b) Redis&lt;br /&gt;
&lt;br /&gt;
c) RabbitMQ&lt;br /&gt;
&lt;br /&gt;
d) None of the options&lt;br /&gt;
&lt;br /&gt;
Answer:- Redis&lt;br /&gt;
&lt;br /&gt;
Question#18 What brokers does celery support?&lt;br /&gt;
&lt;br /&gt;
a) RabbitMQ, Oracle Message Broker, IBM Websphere&lt;br /&gt;
&lt;br /&gt;
b) RabbitMQ, Redis, Oracle Message Broker&lt;br /&gt;
&lt;br /&gt;
c) RabbitMQ, Redis, Amazon SQS&lt;br /&gt;
&lt;br /&gt;
d) Oracle Message Broker, IBM Websphere, Redis&lt;br /&gt;
&lt;br /&gt;
Answer:- RabbitMQ, Redis, Amazon SQS&lt;br /&gt;
&lt;br /&gt;
Question#19 heartbeat_sent, worker_init and celeryd_init are ____ signals&lt;br /&gt;
&lt;br /&gt;
a) beat&lt;br /&gt;
&lt;br /&gt;
b) worker&lt;br /&gt;
&lt;br /&gt;
c) eventlet&lt;br /&gt;
&lt;br /&gt;
d) task&lt;br /&gt;
&lt;br /&gt;
Answer:- worker&lt;br /&gt;
&lt;br /&gt;
Question#20 Which are the features of celery&lt;br /&gt;
&lt;br /&gt;
a) time &amp;amp; rate limts&lt;br /&gt;
&lt;br /&gt;
b) Scheduling&lt;br /&gt;
&lt;br /&gt;
c) work-flows&lt;br /&gt;
&lt;br /&gt;
d) Monitoring&lt;br /&gt;
&lt;br /&gt;
e) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- All the options&lt;br /&gt;
&lt;br /&gt;
Question#21 Celery supports the following serialization&lt;br /&gt;
&lt;br /&gt;
a) pickle&lt;br /&gt;
&lt;br /&gt;
b) YAML&lt;br /&gt;
&lt;br /&gt;
c) JSON&lt;br /&gt;
&lt;br /&gt;
d) msgpack&lt;br /&gt;
&lt;br /&gt;
e) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- All the options&lt;br /&gt;
&lt;br /&gt;
Question#22 Queues created by celery are ____ by default&lt;br /&gt;
&lt;br /&gt;
a) transient&lt;br /&gt;
&lt;br /&gt;
b) persistent&lt;br /&gt;
&lt;br /&gt;
c) none&lt;br /&gt;
&lt;br /&gt;
d) both&lt;br /&gt;
&lt;br /&gt;
Answer:- persistent&lt;br /&gt;
&lt;br /&gt;
Question#23 Celery uses headers to store the content type of the message and its content encoding.&lt;br /&gt;
&lt;br /&gt;
a) True&lt;br /&gt;
&lt;br /&gt;
b) False&lt;br /&gt;
&lt;br /&gt;
Answer:- True&lt;br /&gt;
&lt;br /&gt;
Question#24 Broadcast routing delivers copies of all tasks to all workers connected to a queue.&lt;br /&gt;
&lt;br /&gt;
a) True&lt;br /&gt;
&lt;br /&gt;
b) False&lt;br /&gt;
&lt;br /&gt;
Answer:- True&lt;br /&gt;
&lt;br /&gt;
Question#25 If no custom application has been initiated, celery always creates a special app. It is called&lt;br /&gt;
&lt;br /&gt;
a) app&lt;br /&gt;
&lt;br /&gt;
b) default&lt;br /&gt;
&lt;br /&gt;
c) special&lt;br /&gt;
&lt;br /&gt;
d) celery&lt;br /&gt;
&lt;br /&gt;
Answer:- celery&lt;br /&gt;
&lt;br /&gt;
Question#26 $ celery -A proj control enable_events&lt;br /&gt;
&lt;br /&gt;
is used to&lt;br /&gt;
&lt;br /&gt;
a) add control events&lt;br /&gt;
&lt;br /&gt;
b) dump events&lt;br /&gt;
&lt;br /&gt;
c) disable event messages&lt;br /&gt;
&lt;br /&gt;
d) enable event messages&lt;br /&gt;
&lt;br /&gt;
Answer:- enable event messages&lt;br /&gt;
&lt;br /&gt;
Question#27 To create a queue not defined on task_queues, use&lt;br /&gt;
&lt;br /&gt;
a) task_create_missing_queue&lt;br /&gt;
&lt;br /&gt;
b) task_create_missing_queues&lt;br /&gt;
&lt;br /&gt;
c) task_create_queues&lt;br /&gt;
&lt;br /&gt;
d) task_create_queue&lt;br /&gt;
&lt;br /&gt;
Answer:- task_create_missing_queues&lt;br /&gt;
&lt;br /&gt;
Question#28 A client sending messages is a&lt;br /&gt;
&lt;br /&gt;
a) consumer&lt;br /&gt;
&lt;br /&gt;
b) publisher&lt;br /&gt;
&lt;br /&gt;
c) Broker is RabbitMQ, backend is Redis&lt;br /&gt;
&lt;br /&gt;
d) None of the options&lt;br /&gt;
&lt;br /&gt;
Answer:- Broker is RabbitMQ, backend is Redis&lt;br /&gt;
&lt;br /&gt;
Question#29 Creating a celery instance will do the following&lt;br /&gt;
&lt;br /&gt;
a) Create a logical clock instance, used for events&lt;br /&gt;
&lt;br /&gt;
b) Create the task registry&lt;br /&gt;
&lt;br /&gt;
c) Set itself as the current app&lt;br /&gt;
&lt;br /&gt;
d) Call the app.on_init() callback&lt;br /&gt;
&lt;br /&gt;
e) All the options&lt;br /&gt;
&lt;br /&gt;
Answer:- All the options</description>
<category>Celery</category>
<guid isPermaLink="true">https://madanswer.com/61682/celery-interview-multiple-choice-questions-and-answers-with-explanation?show=61683#a61683</guid>
<pubDate>Thu, 16 Jun 2022 03:20:32 +0000</pubDate>
</item>
</channel>
</rss>