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
50 practiced
List common Python operations on core data structures and state their typical time complexity in plain English: list index access, list append, list insert at start, list pop last, list pop(0), list slicing (copy), membership check 'x in list', dict insertion, dict lookup, dict deletion, and string concatenation with '+' inside a loop vs using join(). Briefly explain why.
MediumTechnical
58 practiced
Implement length_of_longest_unique_substring(s: str) -> int in Python using the sliding-window technique to find the longest substring without repeating characters. Aim for O(n) time and explain the data structures you use and why they make the algorithm linear.
MediumTechnical
54 practiced
Group anagrams: given a list of lowercase words like ['eat','tea','tan','ate','nat','bat'], group them into lists of anagrams. Implement group_anagrams(words: List[str]) -> List[List[str]] in Python and explain the time complexity. Discuss an alternative key representation to sorting each word.
MediumTechnical
57 practiced
Implement a function two_sum(nums: List[int], target: int) -> Tuple[int, int] in Python that returns indices of two numbers adding to target. Your solution should run in O(n) time and O(n) extra space. Provide example input/output and handle negative numbers and duplicates.
EasyTechnical
51 practiced
Demonstrate using a Python dict as a dispatch table to replace a switch/case. Given operations 'sum','mean','median' mapping to functions, show how to call the appropriate function based on a string key and handle unknown keys safely (provide fallback).

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.