Strings
Python String Interview Questions
String questions are about cleaning and comparing text: splitting a field, stripping spaces, matching two identifiers that should be the same and are not quite. It is the daily work of getting two systems to agree.
What string questions ask you to do
Across the questions here, these are the shapes that come up:
- Match two values that differ only in case or spacing
- Split a field on a separator
- Pull out part of a value by its pattern
- Check a property of the characters themselves
- Build one key out of several columns
Common mistakes with strings
Compare the cleaned-up versions, not the raw ones. Case and trailing spaces account for more wrong answers here than any clever parsing does. In pandas the text methods also return nothing wherever the input was empty, so a filter built on one quietly drops those rows.
Questions to practice
- Anagram checkPython
Etsyeasy - First unique characterPython
Amazoneasy - Mirror promo codesPython
Airbnbeasy - Normalize hashtagsPython
Pinteresteasy - Reverse the wordsPython
LinkedIneasy - Balanced bracketsPython
Salesforcemedium - Compress a status logPython
Ubermedium - Group anagramsPython
Pinterestmedium - Most common review wordPython
Etsymedium - Shops per tagPandas
Etsymedium - Longest palindrome in a namePython
Airbnbhard
Questions last reviewed 19 October 2026.