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.

MediumTechnical
53 practiced
Implement the sliding-window algorithm in Python to find the length of the longest substring without repeating characters. Provide code that runs in O(n) time and explain how you maintain the window and what structure stores character positions.
EasyTechnical
48 practiced
Given a list of strings in Python, implement a function that returns a dictionary mapping each unique string to its frequency count. The function should be memory- and time-efficient for moderate lists (millions of items). Show code and explain complexity. Example input: ['a','b','a','c','b','a'] -> {'a':3, 'b':2, 'c':1}.
HardTechnical
67 practiced
Implement an LRU cache in Python with O(1) get and put operations. Do not use collections.OrderedDict; implement the underlying data structure yourself (hash map + doubly linked list). Provide code and explain how you maintain recency ordering and eviction.
MediumTechnical
52 practiced
You need to count occurrences of a substring across very large log files read in fixed-size chunks. Write a Python function that reads chunks and counts occurrences of a target word, correctly handling matches that may be split across chunks. Explain how you handle the boundary and complexity implications.
MediumTechnical
85 practiced
Implement a Python function that returns sliding windows of size k over an iterable without materializing the entire sequence. Each window should be returned as a tuple. Example: iterable [1,2,3,4], k=3 -> (1,2,3), (2,3,4). The function should work for generators and large inputs.

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.