Google interview question

Common interview problems like string processing. Remove repeated chars in a string.

Interview Answers

Anonymous

4 Oct 2015

One naive implementation is using LinkedHashSet, in Java. Add all characters of string in the set and then for every element of the set, add it to StringBuffer and return. Since LinkedHashSet maintains insertion order, if input is "aabcdc", output will be "abcd"

1

Anonymous

1 Jun 2020

The key in generic questions like this, is to make sure to cover the fundamentals. There's usually a back-and-forth with the interviewer. Might be worth doing a mock interview with one of the Google Software Engineer Intern experts on Prepfully? Really helps to get some real-world practice and guidance. prepfully.com/practice-interviews

Anonymous

4 Oct 2015

One naive implementation is using LinkedHashSet, in Java. Add all characters of string in the set and then for every element of the set, add it to StringBuffer and return. Since LinkedHashSet maintains insertion order, if input is "aabcdc", output will be "abcd"

1