Writing stage instructions
The following tips should help you write great stage instructions for your challenge.
The CodeCrafters challenge authors program is invite-only. Interested in building CodeCrafters challenge? Write to us at hello@codecrafters.io.
Stage instructions are the heart of a CodeCrafters challenge. Remember that most learners will be new to both the CodeCrafters platform and your challenge itself, so it’s important to write clear, concise and helpful stage instructions.
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 the
TYPE
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 a
SET
command to your server.It’ll then send a
TYPE
command to your server.Your server should respond with
+string\r\n
, which isstring
encoded as a RESP simple string.It’ll then send another
TYPE
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.
Was this page helpful?