Before You Start
Make sure your challenge:
- Is solvable using TypeScript’s type system
- Works in strict mode
- Has clear requirements and examples
- Includes test cases to verify solutions
You don’t need to provide a detailed solution or guide - just ensure the challenge is solvable. The community will figure out the solutions!
Creating a Challenge
Open a New Challenge Issue
Go to the Type Challenges repository and select the “New Challenge” template.A pull request will be auto-generated based on your issue and will always reflect your changes.
Fill in Basic Information
Provide the basic metadata for your challenge using YAML format:Difficulty Levels:
warm-up- Introduction to the playgroundeasy- Basic type operationsmedium- Moderate complexity, requires understanding of type utilitieshard- Advanced type manipulationextreme- Complex type-level programming challenges
Write the Question
Describe your challenge between the
<!--question-start--> and <!--question-end--> markers. Markdown is supported.Include:- Clear description of what needs to be implemented
- Real-world context (if applicable)
- Example usage showing the expected behavior
Create the Template
Provide the starting template for challengers. This is what users will see when they begin the challenge.Guidelines:Or for function types:
- Use
anyas the placeholder implementation - Include the correct type/function signature
- Keep it minimal - just enough to get started
Write Test Cases
Provide test cases that verify solutions. Use utilities from Tips for Good Test Cases:
@type-challenges/utils for assertions.Available Test Utilities:Expect<T>- Marks a test caseEqual<X, Y>- Asserts two types are equalNotEqual<X, Y>- Asserts two types are not equalExpectTrue<T>- Asserts a type istrueExpectFalse<T>- Asserts a type isfalseNotAny<T>- Asserts a type is notany
- Cover the happy path (basic usage)
- Test edge cases (empty types, unions, etc.)
- Include error cases with
@ts-expect-error - Test with different type combinations
Challenge File Structure
Once your challenge is accepted, it will be added to the repository with this structure:Example: info.yml
Example: template.ts
Example: test-cases.ts
Tips for Great Challenges
Getting Help
Need help creating your challenge?- Discord - Ask in the Type Challenges Discord
- Discussions - Post in GitHub Discussions
- Review Examples - Look at existing challenges in the questions folder