MongoDB Interview Question: Find all anagrams of a word i... | Glassdoor

Interview Question

Junior Software Engineer Interview

Find all anagrams of a word in a dictionary.


Interview Answer

1 Answer


In Python style pseudocode:

reverse ( head ):
    prev = None
    node = head
    while (node != None ):
        next = = prev
        node.prev = next
        prev = node
        node = next
    return prev

Python reverse on Feb 1, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.