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
57 practiced
Write a Python function remove_in_place(lst, predicate) that removes all items from lst for which predicate(item) returns True. The function must modify the input list in place, preserve the original order of remaining elements, and use O(1) extra space (no allocating another list of size n). Provide code and explain time complexity.
MediumTechnical
86 practiced
You have a list of service records: [{"name": "svc1", "latency": 123}, ...]. Implement a stable sort in Python to order services by descending latency. Explain how Python's Timsort preserves stability and why that might matter when sorting by multiple keys (e.g., latency then name). Discuss time complexity and in-place vs returning a new list.
EasyTechnical
48 practiced
Explain how slicing works for lists in Python (syntax: lst[start:stop:step]). Describe behavior with negative indices and steps, whether slicing returns a view or a new list, and the time and memory complexity of creating a slice of length k from a list of length n. For SRE tasks, when might copying via slicing be a dangerous choice and what alternatives exist?
HardSystem Design
48 practiced
Design a streaming top-k system for SRE: you need to keep top-100 most frequent error messages across many services in near-real-time with limited memory. Describe trade-offs between exact counting (hash map + min-heap) and approximate methods (Count-Min Sketch, Space-Saving algorithm). Include error bounds, memory estimates, and when each approach is appropriate.
MediumTechnical
60 practiced
Design a configuration loader that merges defaults (immutable), user configuration, and environment overrides. Describe how you'd implement precedence (env > user > defaults), how to access missing keys safely, and how to handle nested dictionaries. Provide a Python sketch using ChainMap or a recursive merge and discuss pros/cons.

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.