← Questions

Divide a bar into k+1 pieces to maximize the smallest piece

0
GleanCodingLast asked Sep 2026

A coding interview question asked in Glean's coding round, last asked Sep 2026. It tests binary-search, greedy and arrays.

An array of positive integers describes consecutive chunks of a bar, each with a sweetness. Make exactly k cuts so the bar becomes k + 1 non-empty pieces of consecutive chunks.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Glean · Coding · Last asked Sep 2026Live coding, usually two rounds

What it tests

binary-search · greedy · arrays

Your code and the AI tutor open when you unlock this question.