Sector file // dsa
DATA STRUCTURES & ALGORITHMSDECODED.
Algorithms & data structures
Easy
6 questionsWhat is a graph, and how do you represent it?
DSA · 921 views · dsa, graph, adjacency-list
How do you add one to a number represented as a digit array?
DSA · 787 views · arrays, math
How do you find the longest common prefix of an array of strings?
DSA · 742 views · dsa, strings
How do you check for valid/balanced parentheses?
DSA · 690 views · stack, parentheses
How do you check if a string is a valid palindrome?
DSA · 459 views · dsa, two-pointers, strings
How do you check if two strings are anagrams?
DSA · 381 views · strings, hashing
Medium
9 questionsWhat is a trie and when is it useful?
DSA · 1.1k views · trie, strings
Implement Trie for autocomplete — how do you handle wildcards (.)?
DSA · 899 views · trie, string, Google
Decode ways DP: how do you handle 0 and 06 edge cases?
DSA · 612 views · dp, string, Google
How do you group anagrams together?
DSA · 568 views · strings, hashing
How do you find the longest substring without repeating characters?
DSA · 526 views · strings, sliding-window
How do you solve the word break problem?
DSA · 476 views · dp, strings
How do you find the longest common subsequence?
DSA · 363 views · dp, lcs
How do you count the number of islands in a grid?
DSA · 255 views · grid, bfs, dfs
Hard
8 questionsHow does the KMP string-matching algorithm work?
DSA · 1.2k views · dsa, strings, pattern-matching
Minimum window substring: how does the sliding window with need/have counters work?
DSA · 1.0k views · sliding window, string, Meta
How do you find the minimum window substring?
DSA · 932 views · strings, sliding-window
How do you serialize and deserialize a binary tree?
DSA · 870 views · trees, serialization
How do you solve the word ladder problem?
DSA · 817 views · graphs, bfs
Alien Dictionary: given sorted words in an alien language, how do you derive the character order?
DSA · 739 views · topological sort, graph, Google
How do you compute the edit distance between two strings?
DSA · 610 views · dp, strings
How do you solve the N-Queens problem?
DSA · 563 views · dsa, backtracking
Seen a Data Structures & Algorithms question that is not here? Add it and help the next candidate.
Share a question