DataDriven
LearnPracticeInterviewDiscussDaily
HelpContactPrivacyTermsSecurityiOS App

© 2026 DataDriven

Loading lesson...

  1. Home
  2. Learn
  3. Custom Sorting: Intermediate

Custom Sorting: Intermediate

Category
Python
Difficulty
intermediate
Challenges
0 hands-on challenges

Topics covered: External Merge Sort — Sorting Data Bigger Than RAM, functools.cmp_to_key — When key= Isn't Enough, Spark Sorting — The Question Every Senior DE Interview Asks, Topological Sort — Pipeline Dependency Ordering, Sort for Storage Optimization — The Production Insight That Wins Interviews

Lesson Sections

  1. External Merge Sort — Sorting Data Bigger Than RAM

    Full Implementation Chunk Size Tuning

  2. functools.cmp_to_key — When key= Isn't Enough

    The Largest Number Problem (Amazon / Meta Interview Staple) Version String Sorting — Another Classic cmp_to_key Case

  3. Spark Sorting — The Question Every Senior DE Interview Asks

    orderBy vs sortWithinPartitions AQE — Adaptive Query Execution

  4. Topological Sort — Pipeline Dependency Ordering

    Kahn's Algorithm — BFS-Based Topological Sort Level-Parallel Execution — Running Independent Tasks Simultaneously

  5. Sort for Storage Optimization — The Production Insight That Wins Interviews

    Sort Keys in Data Warehouses — Redshift, Snowflake, Delta

Related

  • All Lessons
  • Practice Problems
  • Mock Interview Practice
  • Daily Challenges