BAKER HUGHES Hiring Challenge | Online Assessment Question | On-Campus (2024)

Question · Posted Jun 2026

Q1: Maximum Consecutive Floors Without Special Floors Problem Statement You are given: bottom – the lowest floor. top – the highest floor. An integer array special containing special floor numbers. Find the maximum number of consecutive non-special floors between bottom and top (inclusive). Example Input bottom = 2 top = 9 special = [4,6] Output 3 Explanation Non-special floor ranges: 2–3 → 2 floors 5 → 1 floor 7–9 → 3 floors Maximum consecutive non-special floors = 3

The full answer & interview discussion are available to premium members.

Log in Create a free account