DevForge
ChallengesBuild Redis from scratchImplement SET and GET commands
3

Implement SET and GET commands

Build Redis from scratch

3 hours
Level 3 of 4

Add basic key-value storage with SET and GET operations

Objectives
Complete these objectives to finish this level
  • Store key-value pairs in memory
  • Implement SET command
  • Implement GET command with nil handling
Test Cases
Your implementation should pass these tests
  • SET stores values
  • GET retrieves stored values
  • GET returns nil for missing keys
Hints
  • 💡 Use HashMap for storage
  • 💡 SET syntax: SET key value
  • 💡 GET returns $-1\r\n for missing keys
Challenge Progress
Level 3 of 475%