Siemens Digital Industries OA 2026 | Longest Uniform Signal with K Flips & Trapping Rain Water

Siemens · Question · Posted Jun 2026

Problem 1 - Longest Continuous Signal with Maximum K Alterations Problem Statement You are given a signal stream represented by a character array signal containing only: 'H' (High Signal) 'L' (Low Signal) You may perform at most K alterations, where an alteration flips: 'H' → 'L' 'L' → 'H' Determine the maximum length of a contiguous block containing identical signals after performing at most K alterations. Constraints Constraint 1 ≤ N ≤ 100000 0 ≤ K ≤ N Test Cases ...

The full answer & interview discussion are available to premium members.

Log in Create a free account