Tag view

#strings

Cross-subject tag search for related interview cards.

Clear

Results update as you type. Press / to jump straight into search.

Tagged with strings

16 cards

Python Easy Theory

String formatting and f-strings

Python supports old `%` formatting, `str.format`, and f-strings, with f-strings usually being the clearest modern default.

  • f-strings embed expressions directly
  • format works well for reusable templates
  • % formatting still appears in older code

String formatting and f-strings

JavaScript Medium Theory

Regular expressions basics in JavaScript: pattern matching, flags, groups, and replace/substitution

JavaScript regexes support pattern matching, modifiers, capture groups, and replacement operations for text processing.

  • Flags change matching behavior
  • Groups extract or organize matches
  • Replacement supports templates and callbacks

Regular expressions basics in JavaScript: pattern matching, flags, groups, and replace/substitution

Coding Exercises Easy O(n)

Anagram Check

Either sort both strings and compare them, or build character frequency maps. The hash-map version is linear time and communicates counting skill well.

Check whether two strings contain the same characters with the same counts.

Coding Exercises Easy O(n)

Count Word Frequency

Split the text into words, normalize if needed, and increment counts in a dictionary. Python collections.Counter is great, but interviewers may ask for the manual version first.

Return a frequency map for the words in a sentence.

Coding Exercises Easy O(n)

First Non-Repeating Character

Build a frequency map for the characters, then iterate through the string a second time to return the first character whose count is one.

Return the first character in a string that appears exactly once, or an empty string if none exists.

Coding Exercises Medium O(n * k log k)

Group Anagrams

Use a dictionary keyed by the sorted characters of each word, then append each word into the matching bucket.

Group words that are anagrams of each other and return the grouped lists.