Related Coding / DSA
Cheapest Route Within a Stop Limit
Given one-way routes between cities each with a cost, find the cheapest total cost from a source city to a destination city using at most k intermediate stops.
Given two identical bulbs and a building with F floors, return the minimum number of drops needed in the worst case to guarantee identifying the critical threshold floor.
You have two identical bulbs and a building with F floors (numbered 1 to F). There is some unknown critical threshold T (1 ≤ T ≤ F + 1) such that: - A bulb survives if dropped from any floor ≤ T - 1. - A bulb breaks if dropped from any floor ≥ T. - T = F + 1 means the bulb survives from every floor in the building. A broken bulb cannot be reused. Return the minimum number of drops needed in the worst case to guarantee identifying T. Start with any clarifying questions, then explain your approach.
Work in the provided coding workspace while explaining your decisions to the live interviewer. Validation may use inline tests, examples, comments, or a verbal walkthrough.
Practice this problem in the live coding workspace while the interviewer probes your clarification, implementation, trade-offs, and validation.
Continue to DashboardContinue preparing
Related Coding / DSA
Given one-way routes between cities each with a cost, find the cheapest total cost from a source city to a destination city using at most k intermediate stops.
Related Coding / DSA
Given a 2D grid of land and water cells, count the number of distinct connected land regions, where cells are connected horizontally or vertically.
Related Coding / DSA
Given a sequence of integers (possibly negative) and a target sum, count how many contiguous subarrays sum exactly to the target.
Related Coding / DSA
Given a list of direct exchange rates, find the effective conversion rate between any two currencies by multiplying rates along a path in a directed graph.