Codility Training - Complete 8-Week Lessons
Codility Training - Complete 8-Week Lessons
Comprehensive lessons for your 8-week Codility preparation journey!
š Complete Lesson Files
ā Week 1: Foundations (TypeScript + Basic DSA)
File: week1-foundations.md
Topics: - Day 1: TypeScript basics (functions, arrays, loops) - Day 2: Big-O notation (O(1), O(n), O(n²), O(log n)) - Days 3-4: Array manipulation - Day 5: Edge case handling - Day 6: Review and practice
Challenges: BinaryGap, OddOccurrencesInArray, CyclicRotation, TapeEquilibrium, PermMissingElem
ā Week 2: Counting, Prefix Sum & Hash Maps
File: week2-counting-prefix-hashmaps.md
Topics: - Days 8-9: Counting elements (boolean arrays vs hash maps) - Days 10-11: Prefix sum technique ā VERY IMPORTANT! - Day 12: Hash map patterns - Day 14: Mock Test 1 (45 min, target 70%+)
Challenges: PermCheck, FrogJmp, MissingInteger, FrogRiverOne, GenomicRangeQuery
ā Week 3: Sorting, Greedy & Basic Math
File: week3-sorting-greedy-math.md
Topics: - Days 15-16: Sorting algorithms and patterns - Day 17: Greedy algorithms - Day 18: Simple math in DSA - Day 19: Extra sorting practice - Day 21: Mock Test 2 (60 min, target 75%+)
Challenges: Distinct, MaxProductOfThree, Triangle, TieRopes, CountDiv, PassingCars
ā Week 4: Stacks, Queues, Leaders ā MAJOR WEEK!
File: week4-stacks-queues-leaders.md
Topics: - Day 22: Stack fundamentals - Day 23: Stack simulation (Fish, StoneWall) - Day 24: Leaders & Dominator (Boyer-Moore) - Days 25-27: Review and advanced practice - Day 28: Mock Test 3 (70 min, target 80%+)
Challenges: Brackets, Fish, StoneWall ā, Dominator, EquiLeader
Why Important: Stack problems appear in 40%+ of Codility tests!
ā Week 5: Maximum Slices + DP Basics
File: week5-slices-dp.md
Topics: - Day 29: Kadane's algorithm ā - Day 30: Max double slice (tricky!) - Day 31: DP fundamentals - Day 32: DP practice - Day 35: Mock Test 4 (75 min, target 80-85%+)
Challenges: MaxSliceSum, MaxProfit, MaxDoubleSliceSum, NumberSolitaire
Key Pattern: Kadane's algorithm is essential!
ā Week 6: Binary Search, Peaks, Flags, Sieve
File: week6-binary-search-peaks-sieve.md
Topics: - Day 36: Binary search (on array, on answer) - Day 37: Sieve of Eratosthenes - Day 38: Peaks - Day 39: Flags ā VERY COMMON! - Day 40: Rectangle / Geometry - Day 42: Mock Test 5 (75-90 min, target 85%+)
Challenges: MinMaxDivision, CountFactors, CountSemiprimes, Peaks, Flags, ChocolatesByNumbers
ā Week 7: Reinforcement + Review
File: week7-review-practice.md
Topics: - Days 43-44: Array medium review (LeetCode) - Day 45: Stack & leader review - Day 46: Binary search review - Day 47: Prefix sum review - Day 48: Mini Mock Test (60 min, target 90%+) - Day 49: Free review day
Focus: Fill gaps, increase speed, build confidence
ā Week 8: Final Codility Simulation Week
File: week8-final-mocks.md
Topics: - Day 51: Full Mock Test A (90 min) - Day 52: Review results - Day 53: Full Mock Test B (90 min) - Day 54: Review results - Day 55: Full Mock Test C (90 min) - Day 56: Final self-assessment
Goal: 85-90% correctness + optimized performance
šÆ Quick Pattern Reference
Most Important Patterns
| Pattern | When to Use | Time | Lesson |
|---|---|---|---|
| Prefix Sum | Range queries | O(n) build, O(1) query | Week 2 |
| Stack | Matching, simulation | O(n) | Week 4 |
| Kadane's | Max subarray | O(n) | Week 5 |
| Boyer-Moore | Majority element | O(n) | Week 4 |
| Binary Search | Sorted data, optimization | O(log n) | Week 6 |
| Greedy | Local ā global optimum | Varies | Week 3 |
| Two Pointers | Pairs, subarrays | O(n) | Week 1, 7 |
| Sieve | Prime numbers | O(n log log n) | Week 6 |
Critical Problems to Master
š„ Must Know: 1. GenomicRangeQuery - Multiple prefix sums (Week 2) 2. StoneWall - Stack simulation (Week 4) ā VERY COMMON 3. Fish - Stack with conditions (Week 4) 4. Flags - Greedy + optimization (Week 6) ā VERY COMMON 5. MaxDoubleSliceSum - Two DP arrays (Week 5) 6. EquiLeader - Boyer-Moore application (Week 4)
š Learning Path
Week by Week Goals
Week 1: Foundation - ā Master TypeScript basics - ā Understand Big-O - ā Handle edge cases
Week 2: Core Techniques - ā Counting patterns - ā Prefix sums (CRITICAL!) - ā Hash maps - šÆ Target: 70%+ on mock test
Week 3: Algorithms - ā Sorting strategies - ā Greedy thinking - ā Math optimization - šÆ Target: 75%+ on mock test
Week 4: Advanced Structures - ā Stack mastery - ā Queue operations - ā Boyer-Moore algorithm - šÆ Target: 80%+ on mock test
Week 5: Dynamic Programming - ā Kadane's algorithm - ā DP fundamentals - ā State transitions - šÆ Target: 80-85%+ on mock test
Week 6: Optimization - ā Binary search patterns - ā Prime numbers (Sieve) - ā Complex greedy (Flags, Peaks) - šÆ Target: 85%+ on mock test
Week 7: Consolidation - ā Review all patterns - ā Increase speed - ā Fill gaps - šÆ Target: 90%+ on easier, 75%+ on hard
Week 8: Final Preparation - ā Full-length simulations - ā Time management - ā Confidence building - šÆ Goal: 85-90% overall
š” Study Tips
How to Use These Lessons
Daily Routine: 1. Read the lesson (20-30 min) - Understand concepts thoroughly - Take notes on patterns
- Practice challenges (60-90 min)
- Try solving yourself first
- Compare with provided solutions
-
Understand WHY solution works
-
Track progress (10 min)
- Use the web app
- Mark completed tasks
-
Note difficulties
-
Review (10-15 min)
- What did you learn?
- What was difficult?
- What to practice more?
Maximizing Learning
Do: - ā Solve problems yourself before looking at solutions - ā Understand the pattern, not just memorize code - ā Practice edge cases - ā Time yourself - ā Review mistakes
Don't: - ā Just copy solutions without understanding - ā Skip the "easy" problems - ā Ignore time complexity - ā Forget to test edge cases - ā Give up when stuck (take break, come back)
š Success Metrics
By End of Week 4
- Can solve easy problems in < 5 minutes
- Can solve medium problems in < 15 minutes
- Know basic patterns (prefix sum, stack, counting)
- Comfortable with TypeScript
By End of Week 6
- Can solve most medium problems in < 12 minutes
- Can attempt hard problems
- Recognize patterns immediately
- Handle edge cases automatically
By End of Week 8
- Can solve easy problems in < 3 minutes
- Can solve medium problems in < 10 minutes
- Can solve hard problems in < 20 minutes
- Ready for 85-90% on real test!
š Additional Resources
Codility Resources
Practice Platforms
- LeetCode - Easy/Medium problems
- HackerRank - Algorithm practice
- CodeSignal - Interview prep
TypeScript
š Final Words
You have everything you need: - 8 weeks of structured lessons ā - 50+ solved challenges ā - Complete pattern reference ā - Mock tests for practice ā
Your success formula:
Consistent Practice
+ Pattern Recognition
+ Time Management
+ Edge Case Handling
= 85-90% Success Rate! šÆ
Remember: - Start with Week 1, follow the order - Don't rush - understanding > speed initially - Speed comes with practice - Use the web app to track progress - Review difficult problems multiple times
š Need Help?
If you're stuck: 1. Re-read the lesson explanation 2. Trace through the example step-by-step 3. Try a simpler version of the problem 4. Review the pattern from earlier weeks 5. Take a break and come back fresh
You've got this! šŖ
Start your journey with Week 1: Foundations ā
Last Updated: 2025 Total Lessons: 8 weeks Total Challenges: 50+ Goal: 85-90% Codility Test Success! š