We use analytics and advertising cookies to understand how the site is used and whether our ads on Facebook and Instagram work. They are set only if you accept. See our Privacy Policy for details.
Master fundamental data structures used in technical interviews. Practice questions on arrays, linked lists, trees, graphs, hash tables, and more.
Answer a real Data Structures interview question before you browse the list. No signup needed.
Which flag is NOT included when strict: true is set in tsconfig?
Practice in a session
10 questions from Data Structures, one after another, then your score and streak.
Hash tables, arrays, trees (binary trees, BSTs, tries), graphs, linked lists, stacks, queues, and heaps are the most commonly tested. Hash tables and trees appear in the majority of coding interviews at top tech companies.
Consider the operations you need: fast lookup suggests hash tables, ordered data suggests trees or sorted arrays, FIFO processing suggests queues, and relationship modeling suggests graphs. Understanding time complexity trade-offs for each structure is key.
Arrays offer O(1) random access and better cache locality but O(n) insertion/deletion. Linked lists offer O(1) insertion/deletion at known positions but O(n) access. Arrays are generally preferred unless you need frequent insertions in the middle of the list.
Hash tables provide O(1) average lookup, insert, and delete but no ordering. Trees (BSTs, AVL, Red-Black) provide O(log n) operations with sorted order. Use hash tables when you need fast lookups and trees when you need sorted iteration or range queries.
Very important, especially at FAANG companies. Graph problems test BFS, DFS, shortest path (Dijkstra), topological sort, and cycle detection. Real-world applications include social networks, maps, dependency resolution, and recommendation systems.
A trie (prefix tree) stores strings character by character, enabling O(m) lookup where m is the string length. It is used for autocomplete, spell checking, and prefix-based search problems. Tries are a common topic in interviews at Google, Amazon, and Microsoft.