Logo

Coding preview

The banks are closed.

What this preview is

About this preview

The banks are closed. is a medium quant coding problem on language knowledge in Python.

Unlock full access to getcracked

Join to unlock this problem, detailed solutions, and our complete library of quant finance interview prep.

Practising this interval-coverage Python coding problem

This medium-difficulty coding problem tests your ability to reason about interval overlap and coverage — a core skill in financial systems where transactions must complete within operational windows. You are given opening hours for multiple banks and a set of transaction time windows, and must determine whether each transaction can be fully covered by the union of bank availability.

The key insight is that a transaction succeeds if, at every moment from its start to its end, at least one bank is open. This requires you to either merge overlapping intervals, sweep through time points, or use an event-based approach to track coverage. The problem is complicated by the need to handle midnight boundaries (transactions and hours that wrap into the next day) and potential time-zone normalisation — both common real-world complications in banking systems.

  • Interval merging and union operations
  • Handling time wraparound (24-hour clock and day boundaries)
  • Event-driven or sweep-line algorithms
  • Edge cases: zero-duration windows, simultaneous open/close times