Myntra: Largest histogram rectangle under a cap after removing one bar
Problem. You get an array of building heights and an integer M. Remove exactly one building, then find the largest rectangle area in the remaining skyline whose area is no more than M. It's a twist on the classic largest-rectangle-in-a-histogram problem: the forced removal and the upper cap change what counts as the best answer.
Context. This was one of two coding questions in the online assessment for a six-month SDE internship, alongside 15 multiple-choice questions on OOP, databases, language basics, distributed systems and GenAI basics. The candidate rated the coding difficulty easy-medium to medium and named monotonic stacks and histogram area as the key ideas.
What mattered. The post doesn't give constraints or a sample. In the later interviews the candidate said the panel valued problem solving, optimization and clear communication.
Comments 0
No comments yet. Ask the author something, or add what happened in your own round.