FastPrepFilter Isolated Interior Signal Bits
Problems/Filter Isolated Interior Signal Bits

Filter Isolated Interior Signal Bits

SEDEMAC logoSEDEMAC● EasyNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a SEDEMAC online assessment. The report filters out one-bit noise that sits between zeros, and ignores noise at the edges. In our version all the replacements happen at the same time, and both end bits stay as they are.

Given a binary signal string, replace every interior 1 whose immediate left and right neighbors are both 0 with 0. Determine all replacements from the original signal, so removals are simultaneous. Keep the first and last bits unchanged.

Function

filterIsolatedInteriorBits(signal: String) → String

Examples

Example 1

signal = "01010"return = "00000"

Both interior one bits are isolated in the original signal and are removed simultaneously.

Example 2

signal = "11011"return = "11011"

No one bit has zero-valued neighbors on both sides.

Constraints

  • 1 <= signal.length <= 200000
  • signal[i] is '0' or '1'

More SEDEMAC interview questions

  • Count Palindromic Base RepresentationsOA · Seen Sep 2026
  • Process Singly Linked List OperationsONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Branch with the Most FilesCapital One · OACapital One interview questions
  • Robot Stops Left or Right (Forward Deployed Engineer)Boston Consulting Group · OABoston Consulting Group interview questions
  • Blood Type Inheritance: Possible Parent GenotypesAbridge · OAAbridge interview questions
  • REST API: Highest International StudentsRippling · OARippling interview questions
  • Rearrange String by Alternating EndsHudson River Trading · OAHudson River Trading interview questions
  • Scale Ingredient QuantitiesUpstart · OAUpstart interview questions
  • Telephone Keypad String EncodingEpic · OAEpic interview questions
  • Count Invalid Log GroupsIBM · OAIBM interview questions
  • Count Case-Insensitive TripletsTikTok · OATikTok interview questions
  • Simulate a Deterministic Finite AutomatonPoint72 · OAPoint72 interview questions
See SEDEMAC hiring insights
Saved
class Solution {
    public String filterIsolatedInteriorBits(String signal) {
        // Write your code here.
    }

}
Checking account…