PrepIQ Redis Developer Ultimate Exam, Exams of Technology

This exam helps candidates validate skills in Redis development including data structures, key/value operations, Redis modules, persistence mechanisms (AOF, RDB), clustering, sharding, Lua scripting, performance optimization, caching patterns, pub/sub messaging, and stream operations. Includes scenario-aligned questions on real-time caching, architecture design, memory tuning, transactions, and building scalable microservices using Redis as the data engine.

Typology: Exams

2025/2026

Available from 04/28/2026

shilpi-jain-3
shilpi-jain-3 🇮🇳

2.5

(11)

80K documents

1 / 82

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
PrepIQ Redis Developer Ultimate
Exam
**Question 1. Which of the following best describes Redis?**
A) A relational database that stores data on disk
B) An in-memory key-value store that supports multiple data structures
C) A message queue that requires external persistence
D) A file system for binary large objects
Answer: B
Explanation: Redis is an open-source, in-memory data structure store that
provides strings, lists, hashes, sets, sorted sets, bitmaps, hyperloglogs, and
geospatial indexes, and can be used as a database, cache, or message broker.
**Question 2. Which persistence option writes the entire dataset to disk at
configurable intervals?**
A) AOF (Append-Only File)
B) RDB (Redis Database) snapshotting
C) Lazy free
D) Replication
Answer: B
Explanation: RDB creates point-in-time snapshots of the dataset based on
configurable time or change thresholds, storing the data in a compact binary file.
**Question 3. What is the time-complexity of the Redis command `GET`?**
A) O(N)
B) O(log N)
C) O(1)
D) O(N log N)
Answer: C
Explanation: Retrieving a value by key in Redis is a constant-time operation
because keys are stored in a hash table.
**Question 4. Which use case is NOT a typical scenario for Redis?**
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52

Partial preview of the text

Download PrepIQ Redis Developer Ultimate Exam and more Exams Technology in PDF only on Docsity!

Exam

Question 1. Which of the following best describes Redis? A) A relational database that stores data on disk B) An in-memory key-value store that supports multiple data structures C) A message queue that requires external persistence D) A file system for binary large objects Answer: B Explanation: Redis is an open-source, in-memory data structure store that provides strings, lists, hashes, sets, sorted sets, bitmaps, hyperloglogs, and geospatial indexes, and can be used as a database, cache, or message broker. Question 2. Which persistence option writes the entire dataset to disk at configurable intervals? A) AOF (Append-Only File) B) RDB (Redis Database) snapshotting C) Lazy free D) Replication Answer: B Explanation: RDB creates point-in-time snapshots of the dataset based on configurable time or change thresholds, storing the data in a compact binary file. Question 3. What is the time-complexity of the Redis command GET? A) O(N) B) O(log N) C) O(1) D) O(N log N) Answer: C Explanation: Retrieving a value by key in Redis is a constant-time operation because keys are stored in a hash table. Question 4. Which use case is NOT a typical scenario for Redis?

Exam

A) Caching frequently accessed data B) Storing large binary files (GBs) permanently C) Implementing rate limiting D) Maintaining real-time leaderboards Answer: B Explanation: Redis stores data in memory; large permanent binary objects are better suited to disk-based storage solutions. Question 5. Which command is used to test connectivity to a Redis server via redis-cli? A) CONNECT B) PING C) HELLO D) STATUS Answer: B Explanation: The PING command returns PONG if the server is reachable, confirming the connection. Question 6. In the Redis Serialization Protocol (RESP), how is an array of bulk strings represented? A) Starts with + followed by the number of elements B) Starts with * followed by the number of elements, each bulk string prefixed by $ and its length C) Starts with : followed by the number of elements D) Starts with $ followed by the total byte count Answer: B Explanation: RESP arrays begin with *\r\n, and each bulk string element is encoded as $\r\n\r\n. Question 7. Which configuration directive controls the maximum amount of memory Redis may use?

Exam

B) UNLINK performs asynchronous memory reclamation, avoiding blocking the server C) UNLINK also replicates the deletion to replicas, while DEL does not D) UNLINK can delete multiple keys atomically Answer: B Explanation: UNLINK detaches the key from the dataset and frees its memory in a background thread, preventing the server from blocking on large deletions. Question 11. Why should the KEYS command generally be avoided in production environments? A) It returns keys in random order, causing nondeterministic results B) It blocks the server while scanning the entire keyspace, impacting latency C) It only works on read-only replicas D) It requires the client to be authenticated Answer: B Explanation: KEYS performs a full scan of the keyspace in a single event loop iteration, which can block other operations and degrade performance. Question 12. Which command is the recommended way to iterate over a large keyspace without blocking? A) SCAN B) KEYS * C) HSCAN D) ZSCAN Answer: A Explanation: SCAN provides cursor-based incremental iteration, returning a small batch of keys per call and never blocking the server. Question 13. Which command increments a numeric string value atomically? A) INCRBY

Exam

B) INCR

C) SETINT

D) APPEND

Answer: B Explanation: INCR adds one to the integer value stored at the key, creating the key with value 0 if it does not exist, and operates atomically. Question 14. What does the GETRANGE command do? A) Retrieves a substring of a string value given start and end offsets B) Returns all keys that match a pattern C) Returns the time-to-live of a key D) Retrieves a range of elements from a list Answer: A Explanation: GETRANGE key start end returns the substring of the string stored at key between the specified byte offsets. Question 15. Which pair of commands are used to implement a distributed lock in Redis? A) SETNX and DEL B) GETSET and EXPIRE C) SET with NX and PX options, followed by DEL to release D) INCR and DECR Answer: C Explanation: The recommended pattern uses SET key value NX PX to acquire a lock atomically, and DEL to release it, ensuring safety against deadlocks. Question 16. How many bits can be set or retrieved using SETBIT and GETBIT on a string value? A) Up to 64 bits per key

Exam

C) Deletes the entire list D) Moves elements from one list to another Answer: B Explanation: LTRIM key start stop retains only the elements between start and stop indexes (inclusive) and deletes the rest, useful for implementing capped collections. Question 20. Which command blocks the client until an element is available to pop from a list? A) BLPOP B) LPOP C) BLPUSH D) RPUSH Answer: A Explanation: BLPOP key timeout blocks the client for up to timeout seconds waiting for a non-empty list, then pops the first element. Question 21. Which command atomically moves an element from the tail of one list to the head of another? A) RPOPLPUSH B) LMOVE C) RPUSHLPUSH D) Both A and B Answer: D Explanation: RPOPLPUSH source destination and the newer LMOVE source destination RIGHT LEFT perform the same atomic operation. Question 22. Which command adds a field-value pair to a hash, creating the hash if it does not exist? A) HSET B) HMSET

Exam

C) HADD

D) HINSERT

Answer: A Explanation: HSET key field value adds or updates the field in the hash; if the key does not exist, a new hash is created. **Question 23. How can you increment a numeric field inside a hash atomically? ** A) HINCRBY key field increment B) HINCRBYFLOAT key field increment C) Both A and B, depending on integer vs. floating point D) HSET key field (old+increment) Answer: C Explanation: HINCRBY works for integers, while HINCRBYFLOAT works for floating-point numbers; both perform atomic increments. Question 24. Which command returns all fields and values of a hash? A) HGETALL B) HMGETALL C) HSCAN D) HVALS Answer: A Explanation: HGETALL key returns a flat array of field/value pairs for the entire hash. Question 25. Which of the following is true about Redis Sets? A) They maintain insertion order B) They allow duplicate elements C) Membership checks are O(1) D) They store elements as sorted by score

Exam

Explanation: SINTERSTORE stores the intersection of the given sets into the destination key. Question 29. What is the time-complexity of adding an element to a sorted set with ZADD? A) O(1) B) O(log N) C) O(N) D) O(N log N) Answer: B Explanation: Sorted sets are implemented as a hash table plus a skip list; inserting a new element requires O(log N) time to place it in the skip list. Question 30. Which command returns the members of a sorted set in order of their scores, from lowest to highest? A) ZRANGE key 0 - B) ZREVRANGE key 0 - C) ZRANGEBYSCORE key -inf +inf D) Both A and C Answer: D Explanation: ZRANGE with start 0 and stop -1 returns all members in ascending score order; ZRANGEBYSCORE with the full range does the same. Question 31. How can you atomically increase the score of a member in a sorted set? A) ZINCRBY key increment member B) ZADD key INCR increment member C) Both A and B are valid D) ZSCORE key member ++ Answer: C

Exam

Explanation: Both ZINCRBY and ZADD with the INCR flag increase the score atomically. Question 32. Which command returns the rank (0-based index) of a member in a sorted set ordered by score ascending? A) ZRANK B) ZREVRANK C) ZSCORE D) ZPOS Answer: A Explanation: ZRANK key member returns the rank of the member in the sorted set when sorted from lowest to highest score. Question 33. Which of the following commands is used to add a geographic location to a Redis geospatial index? A) GEOADD B) GEOSET C) GEOINSERT D) GEOLOC Answer: A Explanation: GEOADD key longitude latitude member stores the member’s coordinates in a geospatial index. Question 34. Which command returns all members within a 5-kilometer radius of a given point? A) GEORADIUS key longitude latitude 5 km B) GEONEARBY key longitude latitude 5 km C) GEODIST key member1 member2 km D) GEOSEARCH key FROMLONGITUDE FROMLATITUDE BYRADIUS 5 km Answer: A

Exam

Question 38. Which command merges multiple HyperLogLog structures into a single one? A) PFMERGE dest src1 src ... B) PFUNION dest src1 src ... C) PFCOMBINE dest src1 src ... D) PFCOMBINE dest src1 src ... Answer: A Explanation: PFMERGE creates a new HyperLogLog that represents the union of the source sketches. Question 39. What is the default eviction policy when maxmemory is set and no explicit policy is configured? A) noeviction B) allkeys-lru C) volatile-lru D) allkeys-random Answer: A Explanation: If no policy is specified, Redis defaults to noeviction, meaning writes will fail once the memory limit is reached. Question 40. Which eviction policy removes the least recently used keys among those with an expiration set? A) volatile-lru B) allkeys-lfu C) volatile-random D) allkeys-lru Answer: A Explanation: volatile-lru evicts only keys with a TTL, choosing the least-recently-used among them.

Exam

Question 41. Which command can be used to change the expiration of a key without modifying its value? A) EXPIRE key seconds B) SETEX key seconds value C) PERSIST key D) Both A and C (but C removes expiration) Answer: A Explanation: EXPIRE sets a new TTL on an existing key; PERSIST removes the TTL. Question 42. What does the TTL command return for a key that does not have an expiration? A) - B) 0 C) - D) NULL Answer: A Explanation: TTL returns -1 when the key exists but has no associated expiration. Question 43. Which command returns the remaining time-to-live of a key in milliseconds? A) PTTL B) TTLMS C) PTIMELEFT D) PEXPIRE Answer: A Explanation: PTTL provides the TTL in milliseconds, returning -1 for a key without expiration and -2 if the key does not exist.

Exam

Question 47. Which of the following statements about Lua scripting in Redis is FALSE? A) Scripts are executed atomically B) Scripts can call any external system command C) The EVAL command runs a script supplied as a string D) Scripts can use Redis commands prefixed with redis.call Answer: B Explanation: Lua scripts run inside the Redis server sandbox and cannot invoke external system commands for security reasons. Question 48. Which command is used to evaluate a Lua script that is already cached on the server? A) EVALSHA B) EVALCACHE C) SCRIPT LOAD D) EVALGET Answer: A Explanation: EVALSHA sha1 script-args runs a previously loaded script identified by its SHA-1 hash. Question 49. What is the purpose of the SCRIPT FLUSH command? A) Remove all keys matching a pattern B) Delete all cached Lua scripts from the server C) Clear the command history in redis-cli D) Reset the server’s slow-log Answer: B Explanation: SCRIPT FLUSH clears the script cache, forcing future script executions to be re-loaded.

Exam

Question 50. Which command can be used to monitor all commands processed by the Redis server in real time? A) MONITOR B) TRACE C) DEBUG D) LOG Answer: A Explanation: MONITOR streams every command received by the server to the client, useful for debugging. Question 51. Which command reports the number of keys that have expired but not yet been reclaimed? A) EXPIRECOUNT B) INFO stats (expired_keys) C) MEMORY STATS (expired) D) SERVER EXPIRED Answer: B Explanation: The INFO command’s stats section includes expired_keys, counting keys that have expired. Question 52. What does the SLOWLOG GET command return? A) The last N commands that exceeded the configured slow-log threshold, with execution time and timestamp B) All commands that took longer than 1 second C) The total number of slow commands executed D) A list of keys that caused slow operations Answer: A Explanation: SLOWLOG GET [count] returns entries containing the command, its execution time in microseconds, and when it was executed.

Exam

A) Acknowledges that a consumer has processed specific stream entries, removing them from the pending list B) Deletes entries from the stream permanently C) Creates a new consumer group D) Moves entries from one stream to another Answer: A Explanation: XACK tells Redis that the specified IDs have been processed, allowing the server to track pending messages. Question 57. Which Redis data type is best suited for implementing a rate limiter that allows 100 requests per minute per user? A) Sorted Set with timestamps as scores B) List with a fixed length C) HyperLogLog D) Bitmap Answer: A Explanation: A sorted set can store request timestamps per user; by removing entries older than one minute and counting the remaining members, you can enforce the limit. Question 58. Which command removes elements from a sorted set that have scores outside a given range? A) ZREMRANGEBYSCORE B) ZREMEXTRARANGE C) ZDELRANGE D) ZREMRANGEBYLEX Answer: A Explanation: ZREMRANGEBYSCORE key min max deletes all members whose scores fall within the specified range.

Exam

Question 59. Which command returns the lexicographically smallest members in a sorted set when all scores are equal? A) ZRANGEBYLEX B) ZRANGELEX C) ZLEXRANGE D) ZRANGEBYLEX Answer: A Explanation: ZRANGEBYLEX works on sorted sets where all elements share the same score, allowing range queries based on the member’s lexical order. Question 60. Which of the following commands can be used to atomically set a key only if it does not already exist? A) SET key value NX B) SETNX key value C) Both A and B D) SET key value XX Answer: C Explanation: SET key value NX and the older SETNX command both set the key only when it is absent. Question 61. What will the command INCRBY mykey -5 do if mykey does not exist? A) Return an error because the key is missing B) Create mykey with value - C) Create mykey with value 0 and then decrement by 5, resulting in - D) Do nothing Answer: C Explanation: INCRBY treats a non-existent key as 0 before applying the increment (or decrement), so the final value becomes -5.