REDIS ASSOCIATE
DEVELOPER PRACTICE
EXAM COMPLETE
Question 1: A service stores a user prole with elds name, plan, and login_count.The application frequently updates login_count without rewriting the other elds.Which Redis data structure is the best t?
Choices:
1) String containing serialized JSON 2) Hash 3) List 4) Set
Correct Answer: Hash
Explanation: A Hash supports eld-level reads and writes. HINCRBY can update login_count atomically without serializing and rewriting the whole prole.Page 1
Question 2: A cached API response is always read and replaced as one complete
serialized object. Individual elds are never updated in Redis. Which representation is generally the simplest t?
Choices:
1) String 2) Hash 3) Sorted Set 4) Stream
Correct Answer: String
Explanation: A String is a good t for an opaque serialized value that is read and replaced as a whole. Field-addressable structures add little benet when partial access is not needed.
Question 3: An application must store nested product data containing arrays of
variants and update a property inside one matching variant without rewriting the whole document. Which Redis structure best matches this requirement?
Choices:
1) Hash 2) List 3) JSON document 4) Set
Correct Answer: JSON document
Explanation: Redis JSON supports nested documents, arrays, JSONPath selection, and path- level updates, making it better suited than a at Hash for this access pattern.Page 2
Question 4: HSET inventory:42 stock 10 reserved 2 is executed when inventory:42 does not exist. What does HSET return?
Choices:
1) 0 2) 1 3) 2 4) 12
Correct Answer: 2
Explanation: HSET returns the number of elds that were newly added. Both stock and reserved are new elds, so the return value is 2.Question 5: A Hash already contains elds name and price. The command HSET product:7 price 25 category books is executed. How many newly added elds does HSET report?
Choices:
1) 0 2) 1 3) 2 4) 3
Correct Answer: 1
Explanation: price is updated but already exists, while category is newly added. HSET counts only newly added elds, so it returns 1.Page 3