Question bank › Dynamic Programming
Dsa Dynamic Programming Easy

Optimal Egg Drop

You have a building with `n` floors and `k` eggs. Your goal is to find the lowest floor from which you can drop an egg without it breaking, using the minimum number of drops in the worst case. Implement a function that takes the number of floors `n` and the number of eggs `k` as input and returns the minimum number of attempts needed to find the critical floor. The input consists of two integers, `n` and `k`. Output the minimum number of attempts needed. Example: Input: 10 2 Output: 4

Key concepts

dynamic_programmingrecursionmemoization

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.