Best-matching binary pattern with wildcards
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.
No answer yet. Write the first one; the best answer gets endorsed.
