Amazon.com

  www.amazon.com
  www.amazon.com

Interview Question

Senior Software Engineer Interview Seattle, WA

How would you find if a list of strings, at least one is a

  prefix of another?
Answer

Interview Answer

1 Answer

0

Construct a Radix Tree. Stop when you find a prefix in the tree (i.e., want to extend a leaf node), or the string being added is contained in the tree.

Interview Candidate on Jan 19, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.