Uber Interview Question

Given a regular expression pattern and a string, check to see if pattern matches the string.

Interview Answers

Anonymous

Dec 8, 2015

#1: generate a non-finite automaton (NFA) from the regular expression. #2: convert NFA to Deterministic finite automaton (DFA) #3: run string through DFA to see if there is a match

Anonymous

Aug 5, 2014

Similar to checking if 2 strings are similar (maintain pointers in each string and forward if matches) but look for special chars (like *, & etc)