exam questions

Exam AZ-203 All Questions

View all questions & answers for the AZ-203 exam

Exam AZ-203 topic 24 question 1 discussion

Actual exam question from Microsoft's AZ-203
Question #: 1
Topic #: 24
[All AZ-203 Questions]

HOTSPOT -
A company is developing a gaming platform. Users can join teams to play online and see leaderboards that include player statistics. The solution includes an entity named Team.
You plan to implement an Azure Redis Cache instance to improve the efficiency of data operations for entities that rarely change.
You need to invalidate the cache when team data is changed.
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: Explanation
Box 1: IDatabase cache = connection.GetDatabase();
Connection refers to a previously configured ConnectionMultiplexer.
Box 2: cache.StringSet("teams",")
To specify the expiration of an item in the cache, use the TimeSpan parameter of StringSet. cache.StringSet("key1", "value1", TimeSpan.FromMinutes(90));
References:
https://azure.microsoft.com/sv-se/blog/lap-around-azure-redis-cache-preview/

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
lywwind
Highly Voted 5 years, 3 months ago
Should use cache.KeyDelete https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-web-app-cache-aside-leaderboard The ClearCachedTeams method removes any cached team statistics from the cache.
upvoted 38 times
...
gssicftohbcrcsgtjg
Highly Voted 5 years, 2 months ago
options https://www.examtopics.com/assets/media/exam-media/02838/0020700001.png
upvoted 14 times
...
VijiVivek
Most Recent 4 years, 4 months ago
void ClearCachedTeams() { IDatabase cache = Connection.GetDatabase(); cache.KeyDelete("teamsList"); cache.KeyDelete("teamsSortedSet"); ViewBag.msg += "Team data removed from cache. "; } https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-web-app-cache-aside-leaderboard
upvoted 3 times
...
SidSadhu
4 years, 8 months ago
IDatabase and cache.KeyDelete 100%
upvoted 4 times
...
Pavan2358
4 years, 9 months ago
It says to invalidate the data not delete them, so given answer is correct
upvoted 3 times
maver9ck
4 years, 6 months ago
Answer should be B. Note the Viewbag message in the question image is synonymous to the example on this page - https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-web-app-cache-aside-leaderboard
upvoted 2 times
...
...
SrinivasanKunchithapatham
4 years, 10 months ago
I think cache.KeyDelete("teams") is the correct answer. Please confirm
upvoted 4 times
...
Mnair
4 years, 10 months ago
the second box should be cache.keyDelete - as the keys should be deleted for cache to be deleted.
upvoted 4 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago