Padded Vector Batch Pipeline
Reported by candidates from Siemens's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Siemens reportedly used a padded vector batch problem in September 2026, and the detail that trips people is that padding is local to each batch, not global. You get a list of int arrays, chunk them by batchSize, pad each chunk to its own longest row with padValue, and optionally drop an incomplete last chunk. It's a simulation problem dressed up as a data pipeline. Nothing clever is required, but the edge cases bite if you rush. If you blank during the live OA, StealthCoder runs invisibly as a safety net and hands you the structure. Otherwise, read this and you're set.
The problem
Process vectors in consecutive batches of at most batchSize. Within each retained batch, pad every vector on the right with padValue to the longest vector length in that batch. If dropLast is true, discard the final batch when it contains fewer than batchSize vectors. Return all retained padded vectors in their original order. Padding is local to each batch, so rows from different batches may have different lengths. Function runDataPipeline(vectors: int[][], batchSize: int, padValue: int, dropLast: boolean) → int[][] Examples Example 1 vectors = [[1,2],[3],[4,5,6]] batchSize = 2 padValue = 0 dropLast = false return = [[1,2],[3,0],[4,5,6]] The first two vectors share width two; the one-vector final batch keeps width three. Example 2 vectors = [[1],[2,3],[4]] batchSize = 2 padValue = -1 dropLast = true return = [[1,-1],[2,3]] The incomplete final batch is dropped. Example 3 vectors = [[7],[8,9]] batchSize = 5 padValue = 4 dropLast = false return = [[7,4],[8,9]] An incomplete batch is retained when dropping is disabled. Constraints 1 <= vectors.length <= 10^5 and every vector is nonempty. 1 <= batchSize <= 10^5. The total number of input elements is at most 2 * 10^5.
Reported by candidates. Source: FastPrep
Pattern and pitfall
The trick is that there isn't one. Walk the input in steps of batchSize. For each slice, find the max length, then build new rows padded with padValue up to that length. Check dropLast only for the final slice: if it's true and the slice has fewer than batchSize vectors, skip it. Pitfalls: computing one global max width, which breaks Example 1 where the last row keeps width three. Another is mutating the input instead of building new rows. Also watch the dropLast condition. A full final batch must be kept even when dropLast is true. Complexity is O(total elements) since every element is touched about twice, which fits the 2 * 10^5 cap. Don't use nested rescans or repeated list concatenation. If the logic slips under pressure, StealthCoder is the hedge on the live OA, but this one is a clean ten-minute implementation.
If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.
You can drill Padded Vector Batch Pipeline cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.
Get StealthCoderYou've seen the question.
Make sure you actually pass Siemens's OA.
Siemens reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Padded Vector Batch Pipeline FAQ
How hard is the Siemens padded vector batch problem really?+
Easy. It's pure simulation with no algorithm to recall. The difficulty is careful reading: local padding per batch, original order preserved, and the dropLast rule. Most failures come from edge cases, not from the approach.
What's the trick to padded vector batching?+
Process one batch at a time. Compute that batch's max length, pad each row to it, and append to the result. Never compute a global max. Example 1 shows why: the last batch stays width three while the first is width two.
When exactly should I drop the last batch?+
Only when dropLast is true and the final batch has fewer than batchSize vectors. If the vector count divides evenly by batchSize, the last batch is full and stays. If dropLast is false, keep everything, as in Example 3.
What time complexity do I need?+
Linear in total elements, O(N). With up to 2 * 10^5 elements and 10^5 vectors, one pass to find each batch's max and one pass to build padded rows is plenty. Avoid anything quadratic.
How do I prepare for this in 48 hours?+
Write it once from scratch with the three examples as tests. Add cases for batchSize 1, batchSize larger than the vector count, and an exact multiple with dropLast true. Practice slicing by index so off-by-one errors don't hit you live.