- Collected & curated assignments from around the internets
- Written in JavaScript
- Tested with Jest
- Multiple solutions
- Ideal for exploring TDD tooling, e.g:
- WebStorm debugging capabilities
- Wallaby.js
- Ponicode
- Always start with pen & paper
- Verify:
- Edge cases on inputs
- Limitations & assumptions given in assignment
- Not obvious inputs (e.g. odd number of nodes for function that swaps adjacent nodes)
- Coercing 0 to false in conditions (
typeof x === 'undefined'
instead of!x
)
- Optimization
- Consider which checks are not needed due to input limitations from assignment
- Consider sorting arrays first
- Consider real need of all assertions
- Consider reusing existing data structure instead of creating new ones (e.g. with swapping linked list nodes)
- Consider recursion
- When being extra smart, be also extra careful
I'm not the original author of the assignments! I've just:
- collected & curated them
- reformatted them for better readability (subjective!)
- rewritten examples into runnable tests + authored new ones
- authored my own solutions
- collected various other solutions for comparison
- setup repo for plug'n'play experience
🎓 This repo is only for educational purposes
🙏 I've tried my best to add attributions where they were due.
Original sources:
- https://www.alessiocantarella.it/codility/
- https://codility.com/
- https://www.hackerrank.com/domains/algorithms TODO
- https://github.com/johnmee/codility – Python, exhaustive tests
- https://github.com/Dineshkarthik/codility_training - Python, less verbose, no tests
- https://github.com/Mickey0521/Codility - Java, focus on perf, no tests
- https://github.com/jiqsaw/code-challenges – JavaScript, messy