Bank Operating-Hours Coverage
Updated
Problem statement
Given bank operating intervals operatingHours[i] = [open, close] and a transaction interval transaction, written [start, end], return true if the open hours cover the whole transaction with no gap. Otherwise return false.
Each time is a 24-hour HH:MM string. Different banks may cover one transaction together: intervals that overlap or touch join into one continuous stretch, and the transaction must fit inside one such stretch.
Function
isTransactionCovered(operatingHours: String[][], transaction: String[]) → booleanExamples
Example 1
operatingHours = [["04:20","12:30"],["19:00","21:45"],["14:00","17:30"],["12:30","14:00"]]transaction = ["11:00","17:30"]return = trueThe first, fourth, and third intervals touch end to end, so together they cover 04:20 through 17:30. The transaction fits inside that stretch, so the answer is true.
Example 2
operatingHours = [["09:00","12:00"],["13:00","17:00"]]transaction = ["11:30","13:30"]return = falseNo bank is open between the first interval's close and 13:00. The transaction runs through that gap, so the answer is false.
Constraints
1 <= operatingHours.length <= 10^5.- Every time is a valid same-day 24-hour time and each interval has start no later than end.
- All times use the same timezone.
More Bloomberg LP Phone Screen questions
- Pascal's TrianglePHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026
- Valid Triangle NumberPHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026
- Collatz Conjecture with Shared MemoizationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Fewest Coins CombinationPHONE SCREEN · Seen Nov 2026
- Recommend Films from Viewers Who Watched Everything You DidPHONE SCREEN · Seen Nov 2026
- Track New Values in Sorted OrderPHONE SCREEN · Seen Nov 2026
- Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
Similar questions at other companies
- Minimum Cars for Rental RequestsGoogle · OA · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
- Merge IntervalsApple · OA · PHONE SCREEN · ONSITE INTERVIEWApple interview questions
- Merge Overlapping IntervalsAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
- Peak Chat Load Across AgentsCresta · PHONE SCREENCresta interview questions
- Maximum Concurrent Processes (Bar Raiser Round)Amazon · PHONE SCREEN · ONSITE INTERVIEW
- Meeting Scheduling SystemHevo Data · ONSITE INTERVIEW
- Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
- Maximum Intervals Overlapping a Fixed-Length WindowBooking.com · ONSITE INTERVIEW
- Minimum Rooms for Meeting IntervalsOYO Rooms · PHONE SCREEN
- Meeting Rooms IIByteDance · PHONE SCREENByteDance interview questions
Interview reports that mention this question
Bloomberg LP interview experiences
- Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
- Bloomberg SWE Intern Interview Questions: 68 Questions
- Bloomberg Interview Questions, Level Not Reported: 65 Questions
- Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
- Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 of 2)