exam questions

Exam AI-102 All Questions

View all questions & answers for the AI-102 exam

Exam AI-102 topic 2 question 2 discussion

Actual exam question from Microsoft's AI-102
Question #: 2
Topic #: 2
[All AI-102 Questions]

You are developing a method that uses the Computer Vision client library. The method will perform optical character recognition (OCR) in images. The method has the following code.

During testing, you discover that the call to the GetReadResultAsync method occurs before the read operation is complete.
You need to prevent the GetReadResultAsync method from proceeding until the read operation is complete.
Which two actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.

  • A. Remove the Guid.Parse(operationId) parameter.
  • B. Add code to verify the results.Status value.
  • C. Add code to verify the status of the txtHeaders.Status value.
  • D. Wrap the call to GetReadResultAsync within a loop that contains a delay.
Show Suggested Answer Hide Answer
Suggested Answer: BD 🗳️

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
sdokmak
Highly Voted 2 years, 5 months ago
Selected Answer: BD
as per link in solution
upvoted 13 times
sdokmak
2 years, 5 months ago
and looking at what getReadAsync and getReadResultAsync methods return. getReadResultAsync returns Observable<ReadOperationResult> object which contains as status() method.
upvoted 5 times
sdokmak
2 years, 5 months ago
getReadAsync doesn't have status method. Answer is B and D https://docs.microsoft.com/en-us/dotnet/api/system.io.stream.readasync?view=net-6.0
upvoted 4 times
...
...
...
Pixelmate
Highly Voted 1 year, 5 months ago
this appeared in the exam 28/06
upvoted 7 times
...
vp_2299
Most Recent 8 hours, 41 minutes ago
Selected Answer: BD
as per link in solution
upvoted 1 times
...
nanaw770
6 months, 1 week ago
Selected Answer: BD
results.Status GetReadResultAsync
upvoted 2 times
...
rdemontis
1 year, 1 month ago
Selected Answer: BD
provided answer seems correct. The attached documentation demonstrate it
upvoted 3 times
...
PHD_CHENG
2 years, 6 months ago
was on exam 7 Jun 2022
upvoted 4 times
...
SamedKia
2 years, 7 months ago
C and D are the correct answers.
upvoted 3 times
ppo12
2 years, 5 months ago
I don't think C is one of the answer based on https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/dotnet/ComputerVision/ComputerVisionQuickstart.cs. It seems results.Status is part of the while condition, hence I agree with dokmak's B and D
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 ...