is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
How about this:
- rawat.nav November 10, 2015Maintain a trie of words like following:
For each word:
1) Check if reverse of it is already present in trie:
--> Already present: The pair is found. print the pair.
--> Partially present: either new word is longer or existing word is longer. Check is remaining part is palindrome. If yes, your pair is found, print the pair.
2) Add the word to trie.
e.g. input array ["abcd", "cba", "a", "ta", "bc", .... .... ....]
1) check if reverse of "abcd" is in trie ---- no
2) enter "abcd" in try
3) check if reverse of "abc" i.e. "cba" is in trie - yes partially, remaining "d" is palindrome - print the pair.
4) enter "abc" in trie..
5) check reverse of "a" in trie.. will partially match with "abcd", but remaining "bcd" is not palindrome - NO match
6) enter "a" in palindrome
7) check reverse "ta" ... matches with "a" and "t" is remaining... hence match - print pair.
.. similarly for "ba" and so on...
complexity should be N times O(K) where N is number of words... K is len of max size word