FastPrepMinimum Cake Cuts
Problems/Minimum Cake Cuts

Minimum Cake Cuts

IDFC Bank logoIDFC Bank● EasyOA
QuestionFunctionExamplesConstraints

Problem statement

Source note: The source omits a runnable function signature. The judged core task matches the visible source at about 98%.

You have cakes identical whole cakes and people people. Divide all of the cake equally so that every person receives exactly the same total amount.

A cut divides one existing cake piece into two pieces. Whole cakes and cut pieces may be distributed independently, and one person may receive multiple pieces.

Return the minimum number of cuts required.

Function

minimumCakeCuts(cakes: int, people: int) → int

Examples

Example 1

cakes = 2people = 6return = 4

Each person must receive one third of a cake. Cutting each cake into three equal pieces takes two cuts per cake, for 4 cuts total.

Example 2

cakes = 3people = 2return = 1

Give each person one whole cake, cut the remaining cake in half, and give one half to each person.

Constraints

  • 1 <= cakes <= 10^3
  • 1 <= people <= 10^3

More IDFC Bank problems

  • Employee Free TimeONSITE INTERVIEW · Seen Aug 2026
  • Smallest Adjacent ConcatenationOA · Seen Jul 2026
  • Find All People With SecretONSITE INTERVIEW · Seen Jul 2026
All IDFC Bank interview questionsSee IDFC Bank hiring insights
Saved
class Solution {
    public int minimumCakeCuts(int cakes, int people) {
      // write your code here
    }
}
Checking account…