I am scheduled to have an onsite interview so I am preparing few basic questions. According to the company profile, they are big on string manipulation questions. So far I have manually coded these functions:
Can someone give me a list of more classic string questions which I can practice before going there?
They might ask you about regular expressions. If they are using Java, they might ask the difference of StringBuffer and StringBuilder.
Reverse words in a sentence, e.g.
"string manip interview question"
becomes
"question interview manip string"
this has a solution that uses only one char worth of temporary space.
Make sure your reversal is in-place. You didn't state, so perhaps it already is.
Asking you to re-implementing strstr()
or strtok()
might be up their alley too, I guess.
UPDATE: As a bonus, if you do end up re-implementing either of those, remember to not name your functions starting with str
, since that namespace is reserved. Having a candidate display that knowledge in an interview would impress me, at least. :)
Fast search like Boyer-Moore and Knuth-Morris-Pratt. Fast strlen by examining more than one byte at a time. Simultaneously finding multiple strings in a large body of text with Rabin-Karp. Finding nearest matches with things like Levenshtein distance. Regular expressions and how they might implement parts of it. Various unicode and other multibyte string encodings and how to convert between them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With