InterviewStack.io LogoInterviewStack.io

Core Data Structures Questions

Fundamental built-in data structures used in everyday programming and coding interviews: arrays/lists, strings, and hash maps (dictionaries). For array-like sequences, cover indexing, slicing or sub-ranging, iteration, common mutation operations (appending, inserting, removing elements), common algorithms such as sorting and reversing, and the memory and performance implications of each. For strings, cover indexing, slicing or substring extraction, common operations such as splitting, joining, trimming, and replacing, and general approaches to string manipulation and pattern processing. For hash maps and dictionaries, cover key value semantics, insertion and lookup, iteration patterns, safe access idioms (defaults, existence checks), and using hash tables for counting and grouping. Candidates should know the time complexity of common operations in plain terms (constant time, linear time, quadratic time) and be able to choose the appropriate structure for a problem and reason about space and performance tradeoffs. Practice should include implementation level manipulation exercises and classic interview problems such as two sum and frequency counting, written clearly in whatever language the candidate is most comfortable with (a specific language may be used for concrete code examples without the underlying concept being tied to it).

EasyTechnical
49 practiced
Compare iterating over a list vs iterating over a dict in Python. For each pattern (for x in list, for k in dict, for k,v in dict.items()), state what is being yielded, typical use-cases, and the time complexity of iteration. Show short code examples illustrating safe removal of items during iteration and explain pitfalls.
MediumTechnical
49 practiced
Show examples of using dict comprehensions to transform data: e.g., given a list of (key, value) pairs, produce a dict mapping keys to lists of values (group by key). Provide code and explain time/space complexities and readability tradeoffs vs explicit loops.
MediumTechnical
46 practiced
Write a function merge_sorted(a: List[int], b: List[int]) -> List[int] that merges two sorted lists into a single sorted list using two pointers. Provide in-place strategies when possible, explain time and space complexity, and discuss when you might prefer to allocate a new list vs merge in-place for memory constraints.
MediumTechnical
52 practiced
Design and implement a simple LRU cache class in Python with get(key) and put(key, value) operations. Back it with a dictionary for O(1) lookup and a doubly-linked list for O(1) updates when items are accessed/evicted. Explain complexity and behavior under capacity pressure.
MediumTechnical
56 practiced
Implement a function longest_unique_substring(s: str) -> str that returns the longest substring without repeating characters. Use a sliding-window approach with a dictionary to track last-seen positions. Provide Python code and analyze time and space complexity.

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.