← Questions

Best-matching binary pattern with wildcards

0
GoogleCodingLast asked Jan 2026

You get a list of patterns over 0, 1 and a wildcard that matches either bit, and a query string of bits. Return the pattern that matches the query best. Agree on what "best" means with the interviewer (for example, the fewest wildcards), and make lookups faster than checking every pattern.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding