InterviewStack.io LogoInterviewStack.io

Core Data Structures Questions

Fundamental built in data structures used in everyday programming and coding interviews, focusing on lists, strings, and dictionaries. For lists cover indexing, slicing, iteration, common mutation operations such as append and extend, common algorithms such as sorting and reversing, and memory and performance implications. For strings cover indexing, slicing, common methods such as split, join, strip, replace, and approaches to string manipulation and pattern processing. For dictionaries cover key value semantics, insertion and lookup, iteration patterns, methods for safe access, and using dictionaries as hash tables for counting and grouping. Candidates should also know the time complexity of common operations expressed in plain terms such as constant time, linear time, and quadratic time, and be able to choose the appropriate structure for a problem and reason about space and performance tradeoffs. Practice often includes implementation level manipulations, common interview problems such as two sum and frequency counting, and writing clear code using these structures.

HardTechnical
0 practiced
Implement from-scratch a simple hash table in Python supporting put(key, value), get(key), and delete(key) using open addressing (linear probing). Support resizing when load factor exceeds a threshold. Explain complexity, deletion special cases (tombstones), and how resizing preserves correctness.
MediumTechnical
0 practiced
Implement an in-place list reversal function in Python: reverse_inplace(arr: List[T]) -> None that reverses arr without creating another list. Do not use built-in reverse() or slicing tricks. Explain why your solution is O(n) time and O(1) extra space, and demonstrate with an example.
EasyTechnical
0 practiced
Explain how dictionary insertion and lookup work conceptually in Python (hash table). Describe average and worst-case time complexity for insertion, lookup, and deletion. Mention how Python's insertion-order guarantee (since 3.7) affects iteration and any caveats for AI data pipelines that rely on deterministic ordering.
EasyTechnical
0 practiced
When should you use collections.deque instead of a list to implement a queue? Provide examples showing enqueue and dequeue operations, explain time complexity for both structures, and describe memory trade-offs. Give a short code sample showing how deque.rotate can implement a sliding-window buffer.
EasyTechnical
0 practiced
Given a list of tokens (strings), implement a Python function count_frequencies(tokens: List[str]) -> Dict[str, int] that returns a dictionary mapping each token to its count. Show two different implementations: one using a plain dict and one using collections.Counter. Discuss time and space complexity and when Counter is preferable.

Unlock Full Question Bank

Get access to hundreds of Core Data Structures interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.