exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 5 question 33 discussion

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

You are developing an online game that includes a feature that allows players to interact with other players on the same team within a certain distance. The calculation to determine the players in range occurs when players move and are cached in an Azure Cache for Redis instance.

The system should prioritize players based on how recently they have moved and should not prioritize players who have logged out of the game.

You need to select an eviction policy.

Which eviction policy should you use?

  • A. allkeys-Iru
  • B. volatile-Iru
  • C. allkeys-lfu
  • D. volatile-ttl
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
baroo1
Highly Voted 2 years, 2 months ago
Selected Answer: B
Changed my mind; There must be a way to tell our redis that logged off users must not be prioritized. Sample: User A moves and then automatically logs-off. With allkeys-lru we can't distinguish this particularity. With volatile-lru we can tell our redis what are good candidates to be removed using different TTL values.
upvoted 16 times
exeem
1 year, 3 months ago
A lot of assumptions here but I think it make sense
upvoted 1 times
...
TonyMel
2 years, 1 month ago
correct, in 2023Mar24, score: 904/1000.
upvoted 2 times
...
surprise0011
2 years ago
totally agree with you my friend
upvoted 2 times
...
...
cmmr
Most Recent 5 months, 1 week ago
Selected Answer: A
I still don't understand the advantage of volatile-lru over allkeys-lru in this case. The key in redis is updated when the user moves, not when the user logs in or out. So even with a TTL, a user who is still logged, but hasn't moved in a long time can have an older key compared to a recently logged out user that has just moved before logging out. With that said, and even if a TTL is set when the user moves, chosing volatile-lru will not prioritize logged in users. And as the question doesn't state a TTL is set, all keys need to be evicted (those with TTL and those without). With volatile-lru eviction keys without TTL would be prioritized, but that would mean some users would have their position stored with TTL and some without. That distinction doesn't make sense. So, although B can work, without knowing fore sure we are storing keys with a TTL, A is the safest option.
upvoted 1 times
...
Vichu_1607
5 months, 2 weeks ago
Selected Answer: B
B. volatile-lru
upvoted 1 times
...
overhill
5 months, 3 weeks ago
volatile-lru makes sense because setting a short TTL, will deprioritize logged out players quicker than allkeys-lru. This question is very tricky tough
upvoted 2 times
...
1CY1
10 months, 2 weeks ago
Selected Answer: A
Skip all the assumptions. Doesn't '...and should not prioritize players who have logged out of the game.' mean that we don't look at ttl or make any other changes to the key. Just use 'how recently they have moved', i.e. last recently used. I agree with raymond_abcd. -> A. allkeys-lru.
upvoted 3 times
1CY1
9 months ago
Did exam 29 July 2024, passed with a score of 907. Most questions from ExamTopics. This question was in there, went with this answer. One case study in ExamTopics and one I had not seen before about a Coffee Shop. No Logic Apps or Kubernetes.
upvoted 2 times
...
...
raymond_abcd
1 year, 3 months ago
Selected Answer: A
The default TTL for Redis is infinite, so for volatile-lru to be the correct answer, the config must have the TTL set to some expiration value. Nothing is mentioned in the question about TTL. So it doesn't seem likely that this is the correct answer.
upvoted 1 times
...
FeriAZ
1 year, 3 months ago
Selected Answer: B
volatile-lru: This policy also evicts the least recently used keys but only among those with a set TTL(time to live). Keys without a TTL are not considered for eviction. This policy could be appropriate if you set a TTL for players' data and reset or update this TTL when they move. Players who log out can have their TTL removed or expired, making them ineligible for eviction under this policy.
upvoted 2 times
...
alirasouli
1 year, 3 months ago
Selected Answer: A
I vote for allkeys-Iru. volatile-Iru is helpful to deal with or correlate a concept with expiration time. We have the cache of recent players, and what they do then (for example, logging off) does not affect the eviction policy.
upvoted 1 times
alirasouli
1 year, 3 months ago
The question is confusing, and I carefully re-read it again. If the question is about having a way to de-prioritize the players who are logged off, then a second parameter, like expiration time, is helpful, and volatile-Iru would be the right choice.
upvoted 2 times
...
...
AlexChacon99
1 year, 6 months ago
Hi! I just passed my AZ 204 exam, I have a question, I don't want my employer to know my score, only that I passed, is there any way they can figure out my score if I only show them the certificate PDF ? Thank you!
upvoted 1 times
Ciupaz
1 year, 5 months ago
No, they can't.
upvoted 1 times
...
...
dom271219
1 year, 6 months ago
Selected Answer: A
There's no link with ttl and players who have logged out of the game. In Redis, you can set the TTL (Time To Live) for keys using commands such as EXPIRE, PEXPIRE, or similar commands that allow you to specify a lifespan for a key. The TTL specifies the period for which the key will be retained in the Redis database before being automatically removed.
upvoted 2 times
...
mic_
1 year, 7 months ago
I think the answer is correct. We can remove the related entry from the cache after logoff or simply grab the next entry from the cache if the user is inactive. Volatile policies could even prevent caching, see https://redis.io/docs/reference/eviction/ The policies volatile-lru, volatile-lfu, volatile-random, and volatile-ttl behave like noeviction if there are no keys to evict matching the prerequisites.
upvoted 1 times
...
unraval
1 year, 7 months ago
Selected Answer: B
Think it should be B : volatile-lru volatile-lru : Removes least recently used keys with the expire field set to true. The expire field for the logged out players can be marked true indicating Redis to evict those entries
upvoted 3 times
...
sundeepch1
1 year, 10 months ago
ChatGPT answer option is volatile-ttl
upvoted 1 times
...
aragones
1 year, 11 months ago
Got this 2023-05-12. Had cases: case: You need to configure authorization. case: You need to ensure the app does not time out and processes the blob data case study: VanArsdel Inc Canada
upvoted 2 times
...
adilkhan
2 years, 1 month ago
The "volatile-ttl" eviction policy evicts keys based on their expiration time, which is set when the key is created or updated. This policy is the most suitable for this scenario since it allows the system to prioritize recently moved players by setting a shorter expiration time for their cached location data. It also ensures that players who have logged out of the game are automatically removed from the cache when their data expires. Chat GPT
upvoted 3 times
...
baroo1
2 years, 2 months ago
Selected Answer: A
allkeys-lru: Keeps most recently used keys; removes least recently used (LRU) keys volatile-lru: Removes least recently used keys with the expire field set to true. Source: https://redis.io/docs/reference/eviction/ Not prioritizing logged off players does not mean to remove them! volatile-lru will not be the best solution at all.
upvoted 3 times
...
NombreFalso
2 years, 2 months ago
Selected Answer: A
I think it is A because I don't understand the need to be restricted to only entries with TTL.
upvoted 3 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