Determining total capacity of event - question 3.3 in RU101 - Intro to Redis Data Structures

The virtual lab contains the following key:
“event:PDMM-JUOT-FPFF-BBLO”
What are the total available seats in all seat tiers for that event?
Pick one answer
0
10718
12573
23291 correct
25147
Explanation
This event has two ticket tiers with availability. These can be found with the following command:
hscan “event:PDMM-JUOT-FPFF-BBLO” 0 match available:*
1) “0”
2) 1) “available:General”
2) “12573”
3) “available:Reserved”
4) “10718”
The correct answer of 23291 is the sum of the “available:General” and “available:Reserved” fields.
If you answered with 25147, this is the capacity of the Event, but not the available tickets.
If you answered with 10718 or 12573, then this is the availability for the “available:Reserved” and “available:General”, but not total available for all ticket tiers.
If you answered zero, this is wrong. Possibly, you did not have the sample data loaded in your Redis instance.

Please explain how one may determine the total capacity of the event - does the value of 25147 - 23291 = 1856 belong to some different ticket tier?

Thank you

1 Like

Hello nadird,
Thanks for posting this question! The hash event:PDMM-JUOT-FPFF-BBLO contains a capacity field which can be accessed with the commands HGET or HGETALL.

The amount 1,856 (capacity - sum of available tickets) has not been assigned to any specific tier or field value.

Hope this helps!

1 Like

Thank you very much, Justin.

1 Like