Challenge 2: Predict List Order — Possible Solution ==================================================================== Commands run in order: RPUSH queue:tasks "A" -> list is now: [A] RPUSH queue:tasks "B" -> list is now: [A, B] LPUSH queue:tasks "C" -> list is now: [C, A, B] FINAL ORDER: C, A, B CONFIRMING COMMAND: 127.0.0.1:6379> LRANGE queue:tasks 0 -1 1) "C" 2) "A" 3) "B" WHY THIS WORKS AS AN ANSWER ------------------------------ RPUSH "A" appends A to the (currently empty) list, giving [A]. RPUSH "B" appends to the TAIL again, giving [A, B] — RPUSH calls preserve call order relative to each other, exactly as the chapter described. LPUSH "C" inserts at the HEAD, not the tail — so C is placed BEFORE everything currently in the list, giving [C, A, B], not [A, B, C]. This is exactly the gotcha the chapter's tip box warned about: an LPUSH call doesn't append to the end the way a repeated RPUSH would — it always lands at the front, regardless of what was pushed before it via RPUSH. LRANGE queue:tasks 0 -1 reads the entire list from index 0 (the head) to -1 (the tail, regardless of length), which is the standard idiom for confirming a list's full current contents and order.