The CodeCrafters challenge authors program is invite-only. Interested in
building CodeCrafters challenge? Write to us at hello@codecrafters.io.
Structure
We recommend following this structure when writing stage instructions:- Hook: A short sentence that describes what the user will do in this stage.
- Explanation: A longer explanation of the concepts involved in this stage, and what the user needs to implement.
- Tests: A clear description of how the user’s program will be tested, and what the expected output/behaviour is.
- Notes (optional): Any additional notes or tips that might be helpful for the user.
Example
Here’s an example from the Redis challenge:In this stage, you’ll add support for theTYPE
command.The TYPE command
The TYPE command returns the type of value stored at a given key. It returns one of the following types: string, list, set, zset, hash, and stream. Here’s how it works:If a key doesn’t exist, the return value will be “none”.The return value is encoded as a simple string.Tests
The tester will execute your program like this:It’ll then send aSET
command to your server.It’ll then send aTYPE
command to your server.Your server should respond with+string\r\n
, which isstring
encoded as a RESP simple string. It’ll then send anotherTYPE
command with a missing key.Your server should respond with+none\r\n
, which isnone
encoded as a RESP simple string.Notes
- For now, you only need to handle the “string” and “none” types. We’ll add support for the “stream” type in the next stage.