Data structures are the foundation of every coding interview — and the questions split into two kinds: conceptual ("what's the difference between X and Y, and when would you use each?") and problem-solving ("solve this using the right structure"). This guide covers the conceptual data structures interview questions; for solving problems out loud, see our DSA prep guide and coding communication tips.
Linear structures
- Array vs linked list — access, insertion, memory trade-offs.
- Singly vs doubly vs circular linked list.
- Stack vs queue — LIFO vs FIFO, and real use cases.
- How is a stack used in function calls and recursion?
- What is a deque and a priority queue?
Trees
- Binary tree vs binary search tree (BST).
- Tree traversals — inorder, preorder, postorder, level-order.
- Why do we balance trees (AVL, red-black)?
- What is a heap, and min-heap vs max-heap?
- What is a trie and where is it used?
Hashing & graphs
- How does a hash table work? Collision handling (chaining vs open addressing).
- Time complexity of hash table operations.
- Graph representations — adjacency matrix vs list.
- BFS vs DFS — and when to use each.
- Detecting a cycle; shortest path basics.
Complexity
- Big-O of common operations for each structure.
- How do you choose the right data structure for a problem?
How to prepare
The real test is choosing and justifying a structure out loud while solving. Practise narrating "I'll use X because Y". Greenroom runs spoken technical interviews where you talk through your approach and get feedback on clarity. Pair it with our DSA prep and coding mistakes guides.
Frequently asked questions
What are the most common data structures interview questions?
Common questions cover array vs linked list trade-offs, stack vs queue and their use cases, linked list variants, tree topics (binary tree vs BST, traversals, balancing, heaps, tries), hashing (how hash tables work and collision handling), graph representations and BFS vs DFS, and the Big-O complexity of common operations plus how to choose the right structure for a problem.
When should I use a hash table vs an array?
Use an array when you need indexed access by position, ordered data, or cache-friendly iteration. Use a hash table (hash map) when you need fast lookups, insertions and deletions by key in average O(1) time, such as counting frequencies, deduplicating, or checking membership. The trade-off is that hash tables don't maintain order and have worst-case O(n) operations under heavy collisions.
What is the difference between BFS and DFS?
BFS (breadth-first search) explores a graph level by level using a queue, making it ideal for finding the shortest path in an unweighted graph. DFS (depth-first search) explores as far as possible along each branch before backtracking, using a stack or recursion, and suits problems like cycle detection, topological sorting and exploring all paths. Both visit every node in O(V+E).
How should I prepare for data structures interviews?
Learn not just how each structure works but when to reach for it and its Big-O trade-offs, since interviews reward choosing and justifying the right structure. Practise narrating your choice — 'I'll use a hash map here for O(1) lookup' — out loud while solving, ideally with a voice-based mock interview that gives feedback on how clearly you reason.