Level: Unknown Level
Round: Onsite · Type: Coding · Difficulty: 6/10 · Duration: 120 min · Interviewer: Unfriendly
Topics: String Matching, Rule Engine, Wildcard Matching, Prefix Matching
Location: Mountain View, CA
Interview date: 2026-01-16
Got offer: False
Question: The first question was a simple IP prefix problem, similar to a question discussed online.
Question: The follow-up question involved designing a rule engine to map binary signals to configuration values based on a pattern list.
The initial question was straightforward, focusing on IP prefix matching.
I was asked to design a rule engine that maps binary signals to configuration values. Here's a breakdown:
Problem Description:
The system takes binary signals as input and maps them to specific configuration values. It maintains a list of patterns, each associated with a value.
Input:
Symbol Definitions:
Core Objective:
Implement a match(input) function to find the longest pattern in the pattern list that matches the input and return its value.
Example:
Consider the following pattern list (with \