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.

EasyBehavioral
46 practiced
Behavioral: Tell me about a time you refactored a maintenance script or tool to use a better core data structure (lists vs dicts vs sets) and that led to measurable reliability or performance improvements. Use the STAR format (Situation, Task, Action, Result) and quantify the impact if possible.
MediumTechnical
60 practiced
Explain, in plain terms, the time complexity (constant, linear, quadratic) for common operations on Python core data structures: list append, pop (end), pop(0), indexing, slicing; string indexing and concatenation; dict lookup, insertion, and deletion. Also explain what amortized constant time means for append and why it matters for SRE scripts that append frequently.
EasyTechnical
65 practiced
Describe string immutability in a language like Python. Explain how operations such as indexing (s[i]), slicing (s[a:b]), and methods like s.replace(old, new) behave with respect to object creation. Discuss time complexity of indexing and slicing, and explain why repeated concatenation in loops can be slow in production SRE scripts.
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.
HardTechnical
59 practiced
Given up to 1 million lowercase ASCII strings, design and implement in Python an efficient approach to group anagrams together. Provide an implementation that minimizes memory overhead compared to storing sorted strings for keys, and explain your choice of keying function (sorted string vs fixed-size frequency tuple). Consider performance for very long strings.

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.