What makes an input bounded — yesterday's finished files against a feed that never stops — and what does that ending buy?
answer
- does the reading ever finish?
- an end, not a size
- totals need a last record
- final answer against a running one
basics
~20 sA bounded input has a last record the reader can reach; an unbounded one does not. Reaching that last record is what lets a job produce one total, one global sort or one rank, call it final, and stop.
solid answer
~50 sBoundedness is a property of the data, not of the machinery reading it. A bounded input is one whose membership is already settled, so a reader that keeps going arrives at a last record and observes that there is nothing more; an unbounded input keeps being produced, so there is no last record and no moment at which everything has been seen. Everything that needs *all* the records depends on that ending: a count or a sum over the whole input, a global sort, a rank or a top-N, an exact maximum, and the right to label a number final. An ending also buys recomputation — as long as the input still exists unchanged, running the same logic over it again yields the same answer. Once the ending is gone you have to impose a boundary of your own and accept answers that are true as of the records seen rather than true once and for all.
go deeper
Be able to say it in one line: a bounded input has a last record, an unbounded one does not, and totals, sorts and the word final all depend on reaching that last record.
Explain which computations break and why — anything whose answer is uncertain until every record is seen — and name the two replacements: a boundary you impose, or a value revised as more arrives.
Show that you settle boundedness before anything else in a design, and that you can price what the ending was worth: a number that can be published as final and a rerun that reproduces it.
Frame it as a platform question: which inputs genuinely have no end, and what the house contract is for publishing from those, so each team does not invent its own meaning for a changing number.
## What "bounded" actually means An input is **bounded** when the set of records the computation is defined over is already settled: every record that will ever belong to it exists, so a reader that keeps going reaches a last one and observes that there is nothing further. An input is **unbounded** when no last record exists — something is still producing, and any point at which the reading stops is a point the reader chose, not one the data announced. Four things this distinction is *not*: - **Not a size statement.** A twelve-row file nobody will ever append to is bounded. One record an hour, forever, is unbounded. Size decides whether you need more than one machine; boundedness decides what you are allowed to compute. - **Not a speed statement.** A finite input can trickle in over hours; an endless one can arrive in a torrent. - **Not a statement about transport.** Files that keep appearing in a watched location are unbounded. A fixed slice of a continuous feed, pinned between a start and an end boundary you chose, is bounded. - **Not a statement about how the job runs.** Whether the runtime handles each record the moment it arrives, or collects an interval's arrivals and executes an ordinary finite job over just that slice, is an independent choice and a separate subject. ## What the ending buys Everything that needs to have seen *all* the records is available only when there is a last record to reach. | What you want | Why it needs the end | What is left without it | |---|---|---| | A count or sum over the whole input | it is only the total once nothing more can be added | a running value, or a total within a boundary you impose | | A global sort | the first output position is uncertain until the smallest remaining record is known | an ordering within an imposed boundary only | | A rank or top-N | any unseen record could displace an entry | a running list, correct as of the records seen | | An exact maximum or exact distinct count | one more record can move either | a value that may still move | | The word "final" on a published number | finality is the claim that no later record can change it | "as of" a stated point | | A rerun that reproduces the answer | the input still exists and is unchanged, so the same logic gives the same result | re-reading later covers a longer input | The three things an ending buys, in the order they usually decide a design: 1. **A single final answer.** The job computes, emits once, and exits. Downstream readers get one value with no versioning problem. 2. **A total ordering.** Sorting and ranking are only meaningful over a set whose membership is closed. 3. **Reproducibility by recomputation.** A logic error found later can be answered by running the corrected program over the same input from the top, as long as that input is still there unchanged. ## What you must invent once the ending is gone - **A boundary of your own.** Nothing in an endless input proposes one, so the computation has to impose it — the shapes such a boundary takes, and when the grouping emits, are a separate subject. - **An output that is revised.** Instead of one value produced once, you get a sequence of values, each correct as of the records already seen. - **A rule that keeps memory finite.** A bounded input lets you retain everything until the end because the end arrives; an endless one does not, so something must expire or fold records away. - **A way to say what a number covers.** Without an ending, a published figure needs an as-of marker to mean anything. ## Where candidates go wrong - Treating **bounded** as a synonym for *small*. A multi-terabyte archive is bounded; it simply needs a cluster execution engine — a system you hand a whole program to, which splits the work across many machines, runs the pieces and puts the results back together. - Calling an input endless because of how it travels. Transport is not membership. - Promising a stakeholder a total over an input that never ends, then discovering at review time that the number changes every day and nobody agreed what it means. - Believing an unbounded input yields nothing useful. It yields plenty; what it does not yield is a number that cannot change. The practical habit is to ask boundedness first, before size, before choosing any system: it is the property that decides whether the requirement as written is even satisfiable.
- A producer is still writing files into a location. Is that input bounded once it stops?It becomes bounded only when something tells the reader the writing is over. The records themselves carry no such signal, so producers publish an explicit completion marker, or the reader is given a fixed list of files. Without one, a job that starts early silently computes a total over a partial set and reports it as complete.
- Does a bounded input guarantee that a rerun produces the same answer?No. It removes one obstacle — the input still exists and its membership is closed — but the logic must also be deterministic and the input unchanged. Ordering-sensitive steps, sampling and anything reading wall-clock time can still differ between runs; that repeatability question belongs to the job's own dataflow, not to boundedness.
- Is boundedness a property of the source or of the computation?Of the record set the computation is defined over, which is the two together. The same source supports both readings: everything already written is bounded, while the same location read continuously for new arrivals is not. Saying which one you meant is the whole of the answer in a design review.
A shop that closes at six can announce the longest wait of the day once the doors shut; a twenty-four-hour shop can only ever announce the longest wait so far, and tomorrow's figure may overwrite it.
saying these in an interview costs you the question
- Says bounded just means small enough for one machine
- Calls an input unbounded because it arrives over a network
- Claims nothing useful can be computed over an endless input
- Thinks the runtime, not the data, decides whether there is an end
- Believes a total over an endless input only needs more memory