exam questions

Exam AZ-202 All Questions

View all questions & answers for the AZ-202 exam

Exam AZ-202 topic 5 question 4 discussion

Actual exam question from Microsoft's AZ-202
Question #: 4
Topic #: 5
[All AZ-202 Questions]

HOTSPOT -
You are developing an SMS-based testing solution. The solution sends users a question by using SMS. Early responders may qualify for prizes.
Users must respond with an answer choice within 90 seconds. You must be able to track how long it takes each user to respond.
You create a durable Azure Function named SendSmsQuizQuestion that uses Twilio to send messages.
You need to write the code for MessageQuiz.
How should you complete the code? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: DateTime expiration = context.CurrentUtcDateTime.AddSeconds(90);
The user has 90 seconds to respond with the code they received in the SMS message.
Box 2:var timeoutTask = context.CreateTimer(expiration, cts.Token);
Create a timer.
Box 3: if(!timeoutTask.IsCompleted)
All pending timers must be complete or canceled before the function exits.
References:
https://github.com/Azure/azure-functions-durable-extension/blob/master/samples/precompiled/PhoneVerification.cs

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
AnshMan
5 years ago
Almost relates to the question and explanation : https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-phone-verification?tabs=csharp
upvoted 4 times
...
AnshMan
5 years ago
Same question is asked in AZ-300 also
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...