Loading...
Loading...
Browse 3 real-world technical and behavioral interview questions about Streams. Review scenarios, edge cases, and architectural best practices.
Node.js stream backpressure prevents a fast producer from filling memory while a slow consumer catches up. The core signal is write() returning false and the producer waiting for drain before sending more.
Laziness means intermediate operations only describe a pipeline, so nothing traverses the source until a terminal operation pulls, and short-circuiting operations can stop early. Parallel helps when the source splits evenly, the work per element is CPU-bound and substantial. Use this streams answer to show the decision, trade-off, and evidence rather than a memorised definition.
A collector is a supplier of a mutable container, an accumulator that folds one element into it, a combiner that merges two containers, and a finisher. The combiner runs only in parallel, which is why an untested combiner is the usual defect, and the characteristics tell the pipeline what it may skip or reorder.