Coding Interview Questions

Learn to solve 89 coding problems across eight categories. Choose a compiler, run real test cases, use helpful hints, and reveal explained solutions when you're ready.

String Questions

Palindromes, sliding windows, anagrams and parsing.

1Reverse a StringReverse the characters in a string.Practice2Check a PalindromeReturn true if a string reads the same forwards and backwards.Practice3First Non-Repeating CharacterReturn the first character appearing only once, or an empty string.Practice4Valid AnagramDetermine whether two strings have exactly the same characters with the same frequencies.Practice5Longest Substring Without RepeatsFind the length of the longest substring containing no repeated characters.Practice6Longest Palindromic SubstringReturn the longest contiguous palindrome; for ties, return the earliest.Practice7String to Integer (atoi)Convert a string to a signed 32-bit integer, stopping at the first invalid character.Practice8Implement strStr()Find the index of the first occurrence of a substring, or -1.Practice9Longest Common PrefixFind the longest prefix shared by all strings in the array.Practice10Valid ParenthesesValidate matching parentheses, square brackets and curly braces.Practice11Group AnagramsGroup words that contain the same letters. Return groups ordered by first occurrence.Practice12Length of Last WordReturn the length of the last word, ignoring trailing spaces.Practice13Reverse Words in a StringReverse the order of words and normalise spaces.Practice14Repeated DNA SequencesReturn repeated 10-character DNA substrings in first-repeat order.Practice15Count and SayReturn the nth term of the Count and Say sequence (n starts at 1).Practice16Roman to IntegerConvert a valid Roman numeral to an integer.Practice17Integer to RomanConvert an integer from 1 through 3999 to Roman numerals.Practice18Zigzag ConversionWrite characters in zigzag rows and read them row by row.Practice19Minimum Window SubstringFind the shortest substring containing all target characters with multiplicity.Practice20Add Binary StringsAdd two binary strings and return the binary sum.Practice

Array Questions

Two pointers, prefix sums and arrays.

Hash Maps

Counting, sets, fast lookups and cache design.

Linked Lists

Pointer manipulation, cycles and merging.

Sorting & Searching

Binary search, sorting and intervals.

Recursion

Base cases, backtracking and recursive reasoning.

Trees & Graphs

Traversals, graph connectivity, DFS and BFS.

Dynamic Programming

Optimisation, memoisation and tabulation.

Your drafts and progress stay in your browser. No sign-in needed. Results are intended for learning, not secure competitive grading.