Lesson overview · Free interview practice

Combinatorial Optimization

Optimize an objective function within a finite set of possible solutions.

Topics in the full lesson
  • Concept and Use Cases
  • Key Concepts
  • Time and Space Complexity
  • Combinatorial Optimization Algorithms and Methods
  • Practical Tips and Tricks
  • Common Gotchas
  • Advanced Topics
  • Interview Tips and Tricks
  • Common Mistakes

Practice Problems

Work through a question before revealing its explanation. These questions and answers are free; Premium adds the full lesson walkthrough, examples and implementation detail.

Completion marks record your own progress, not an automatically checked result. The task type does not determine whether it is optional.

Question

There are some balloons on a wall represented by 2D coordinates points, where points[i] = [x_start, x_end]. Arrows are shot vertically from the ground; an arrow at position x bursts every balloon whose x_start <= x <= x_end. Return the minimum number of arrows required to burst all balloons.

Take a moment to think about this before revealing the answer

Explain your reasoning or try an implementation before comparing answers.

Question

You have some sticks with positive integer lengths. You can connect any two sticks of lengths x and y into a new stick of length x + y at a cost of x + y. Return the minimum total cost to connect all sticks into one stick. (Greedy with a min-heap: always combine the two shortest sticks.)

Take a moment to think about this before revealing the answer

Explain your reasoning or try an implementation before comparing answers.

Explore the full Combinatorial Optimization material

Premium includes the complete lessons and implementation references. Free practice questions remain available without a subscription.

All course tracks & premium content
From basics to advanced masterclasses
Built for JS/TS developers like you
Real-world tips & common pitfalls
Upgrade to Premium