πŸͺ TechCookies
HomeDSASystem DesignJSMy Progress
Free
Log inStart free
TechCookies β€” Practice Β· Learn Β· PrepareTechCookies β€” Practice Β· Learn Β· Prepare
ConceptsPracticeSD challengesPricingPrivacyTermsContact
Β© 2026 TechCookies
DSAβ€ΊBig O & Complexity
Ξ©Big O & ComplexitybeginnerFree
ComplexityTimeSpaceAnalysis
Practice
0/10 done~58 min
1
Why algorithm speed matters
Read
~4 min
πŸ”’
How to read and write Big-O
ReadVisual
Complete previous first
πŸ”’
Recognising patterns at a glance
Read
Complete previous first
πŸ”’
Space complexity
ReadQuiz
Complete previous first
πŸ”’
Space-time tradeoffs and amortized analysis
ReadQuiz
Complete previous first
πŸ”’
Interview-ready complexity analysis
ReadQuiz
Complete previous first
πŸ”’
Spot the non-obvious complexity
Pattern
Complete previous first
πŸ”’
Guided problem β€” Two Sum brute force β†’ optimal
Code
Complete previous first
πŸ”’
Expert problem β€” Contains duplicate
Code
Complete previous first
πŸ”’
Expert problem β€” Valid Palindrome (Trap 1 in code)
Code
Complete previous first
1 / 10Read~4 min
Why algorithm speed matters

Imagine you have 1 million users. An O(nΒ²) algorithm takes 1 trillion operations on their data β€” that's a 30-minute request. An O(n log n) algorithm takes about 20 million operations β€” under a second.

Big-O is not about measuring exact speed. It describes how an algorithm's cost grows as the input grows. You're answering: If I double the input, what happens to the work?

The scale that matters most in interviews:

NotationName10 items10 000 items1 000 000 items
O(1)Constant111
O(log n)Logarithmic31420
O(n)Linear1010 0001 000 000
O(n log n)Log-linear33133 00020 000 000
O(nΒ²)Quadratic100100 000 00010ΒΉΒ²

Most interview problems want O(n) or O(n log n). An O(nΒ²) brute force is almost always improvable.

Read through to continue
Notes
πŸ”
Loading…
Sections
0/10 done~58 min
1
Why algorithm speed matters
Read
~4 min
πŸ”’
How to read and write Big-O
ReadVisual
Complete previous first
πŸ”’
Recognising patterns at a glance
Read
Complete previous first
πŸ”’
Space complexity
ReadQuiz
Complete previous first
πŸ”’
Space-time tradeoffs and amortized analysis
ReadQuiz
Complete previous first
πŸ”’
Interview-ready complexity analysis
ReadQuiz
Complete previous first
πŸ”’
Spot the non-obvious complexity
Pattern
Complete previous first
πŸ”’
Guided problem β€” Two Sum brute force β†’ optimal
Code
Complete previous first
πŸ”’
Expert problem β€” Contains duplicate
Code
Complete previous first
πŸ”’
Expert problem β€” Valid Palindrome (Trap 1 in code)
Code
Complete previous first
Notes
Notes
πŸ”
Loading…