I described and wrote pseudocode to build a trie from the list of valid words and then do a recursive backtracking search on it. That may have been overly complicated though.
This is the answer I could come up with. Correct me if i'm wrong. Assign prime numbers(don't include 2) to each of the alphabets(ex: a=3,b=5,c=7) Write a custom hash function which multiplies the values of the letters in the word. Hash the list of words given using this function. Each time the same key appears increase the count for that value. Now when the word is given, its permutation can be found in constant time.
Sort the given word. Use that sorted string as a key or comparator. Iterate through the raw list of English words, sorting each one and compare that sorted version to the given word's key. If they are equal, then add to a HashSet. One should keep in mind that the question asks for valid English words, which would never be long nor arbitrary. This means that the sorting of each entry would not be expensive. This should run in O(n) time, where n is the size of the list of valid English word.
I was silent, then I asked for clarification, and then I stammered out a response to the effect of "I'm competent in the use of all common hand tools used in the day to day maintenance of commercial office buildings." Perhaps the interviewer was expecting a story about how I am the master of the 10 way screwdriver. Who knows, right?
A very vague question in deed. I suppose the best tool we have as human beings is the ability to reason through questions like these.
I kept trying to think of questions to ask, thinking if I didn't ask questions she would think I wasn't interested. Then, I realized by her tone she was really telling me that she was done and hopefully, so was I.
The world's largest real estate franchisor. under the umbrella known as Realogy, there are world known brands such as: Coldwell Banker, Coldwell Banker Commerical, Sotheby's International Real Estate, Better Homes & Gardens Real Estate, ERA, Century 21
Realogy actually is a combonation of the the Real and olgy.. The STUDY OF REAL ESTATE. Just in BIOLOGY....