Data Structures Interview Questions
20 interview questions in our bank cover Data Structures, most of them Coding Questions. They average 2.9/5 difficulty — medium — and each one was reported by a candidate after a real interview. Companies known to ask about Data Structures: Apple, Google, Databricks, Goldman Sachs, Amazon, and 7 more.
Practice these on the problems board →Companies that ask about Data Structures
Question mix
- Coding Questions20
Difficulty
- 2/5 — easy4
- 3/5 — medium15
- 4/5 — hard1
Data Structures questions at Apple
Implement an Iterator Interface
3/5Implement a generic iterator over a linked structure that can advance, report whether more elements remain, and delete the element it is sitting on. Asked at Apple, the deletion is the hard part: an iterator that removes must keep a handle on the previous node and must refuse to delete twice in a row. You will define the node type yourself, raise the right exceptions at the boundaries, and demonstrate it from a test harness. A subscription unlocks the full problem and the reference implementation.
Coding QuestionsAppleDesign and Implement a HashMap from Scratch
3/5This foundational data structures interview question from Apple asks you to build a hash table from the ground up without relying on native language libraries. You must implement standard dictionary operations while demonstrating a deep understanding of collision resolution strategies such as chaining or open addressing. The task tests your grasp of memory management, hashing functions, and amortized time complexity analysis. To view the complete requirements, architectural considerations, and reference implementation, a paid subscription is required.
Coding QuestionsAppleDesign a Hit Counter for the Past 5 Minutes
2/5This widely encountered interview challenge from Apple focuses on designing an efficient time-based data tracking mechanism capable of monitoring activity frequency over a sliding temporal window. Candidates are tasked with building a lightweight system that can record timestamped events and rapidly compute occurrences within a recent three-hundred-second duration under chronological constraints. This exercise evaluates proficiency in managing queues, optimizing state storage, and handling fast lookup queries. The complete problem statement, optimal algorithmic approach, and thoroughly tested model solution require a subscription.
Coding QuestionsAppleDesign a Key-Value Store with Point-in-Time Snapshots
3/5A coding question about a string-to-string store that can freeze its contents and answer queries about any earlier frozen state. It looks at versioning, storage that does not blow up with many frozen states, and handling unset keys and invalid ids.
Coding QuestionsApple
Data Structures questions at Google
Design Bookshelf Class
3/5Design a shelf that holds books in order and supports adding, removing, and relocating a title to a chosen position. Asked at Google, this is an interface-design question where the specification deliberately says that absent titles are ignored rather than raising. You will choose the backing structure with the operation costs in mind, define what an out-of-range position does, and decide whether duplicate titles are allowed. Subscribers get the complete problem and the reference class.
Coding QuestionsGoogleDesign FancySet With Amortized O(1) Add / Remove
3/5Mastering advanced data structure design is essential for tackling this Google interview challenge, which requires you to build a specialized collection maintaining swift constant-time performance across insertion, deletion, membership testing, and random sampling. This problem evaluates your deep understanding of memory management, underlying hash maps, and index tracking techniques to achieve amortized efficiency. You will need to carefully orchestrate multiple internal storage mechanisms to ensure every operation runs seamlessly without performance degradation. Upgrade your account to unlock the comprehensive problem description, architectural analysis, and complete model solution.
Coding QuestionsGoogleNext Greater Element to the Right
3/5A coding question about finding, for every position in a list of integers, the closest later value that is strictly bigger, with a linear-time requirement and attention to duplicates and negative numbers.
Coding QuestionsGoogle
Data Structures questions at Databricks
Reconstruct a Binary Tree from Inorder Traversal (Follow-up)
3/5Explain why one traversal order alone cannot pin down a binary tree, and say what extra information would make the reconstruction unique. This Databricks follow-up is a discussion question with a precise answer: the in-order sequence fixes the left-to-right arrangement but not the shape, and a second traversal or a structural marker resolves it. You will produce a counterexample, then describe the reconstruction once the extra information is available. Subscribers get the complete problem and the full discussion.
Coding QuestionsDatabricksSnapshotSet with Iterator
3/5A coding question on designing an ordered collection of integers whose iterators are frozen views of the data at creation time. It tests how to keep insertion, lookup and iterator creation cheap while the collection keeps changing, and how to reason about duplicates and iterator independence.
Coding QuestionsDatabricks
Data Structures questions at Goldman Sachs
Hash Map With Separate Chaining
3/5A coding question on building a key-value table in which different keys can map to the same slot. You decide how to store colliding keys, when to enlarge the table, and how to keep operations fast on average.
Coding QuestionsGoldman SachsFIFO Queue from Two Stacks
2/5A coding question on building a first-in, first-out queue out of two last-in, first-out stacks, with push, pop and an error on an empty queue.
Coding QuestionsGoldman Sachs
Data Structures questions at Amazon
Linked List Manipulation
3/5Reverse the back half of a singly linked list in place, leaving the front half as it was, with no extra storage. This Amazon question combines two standard techniques: finding the midpoint with a fast and a slow cursor, then reversing a sublist by relinking. You will keep a handle on the node where the two halves join, rewire the pointers in the right order, and verify the result on the odd-length case the statement promises. Subscribers can read the full problem and the model solution.
Coding QuestionsAmazonManage Party Playlist with Person and Party Classes
3/5Design two classes that together manage a party playlist built from the songs each guest recommends, ordered by popularity and then by when the recommendation arrived. This Amazon question is scored on the structures you pick: the ordering needs counts plus an arrival sequence, and removing a guest has to withdraw their recommendations. You will keep the ordering query cheap, define what happens when a guest recommends the same song twice, and handle removal of someone who never joined. The complete problem and the reference design are available with a subscription.
Coding QuestionsAmazon
More Data Structures questions
Segment Tree Problem
3/5Answer many range-minimum questions over a fixed array fast enough that scanning each range is not an option. This DoorDash question asks for the tree structure itself rather than a library call, so the indexing scheme, the build step, and the recursive query all have to be right. You will handle one-based input bounds, choose between recursive and iterative forms, and state the build and query costs separately. The complete problem and the reference implementation are available to subscribers.
Coding QuestionsDoorDashDeep Copy a Singly Linked List
3/5Duplicate a singly linked list so that the copy shares no node with the original and neither can be changed through the other. This Grammarly question is short but specific: every node must be newly allocated and the link structure must match exactly. You will build the copy in one pass with a trailing pointer, handle the empty list, and explain how the approach would change if nodes carried extra references. A subscription unlocks the complete problem and the reference solution.
Coding QuestionsGrammarlyData Structures Characteristics
3/5Prepare for your upcoming technical interview with General Motors by exploring the foundational traits of essential computer science containers. This curated challenge evaluates your ability to compare and contrast various organizational strategies, examining the trade-offs, performance strengths, and specific operational contexts best suited for each architecture. You will review how different memory layouts impact retrieval and modification efficiency across sequential and hierarchical layouts. Access to the comprehensive breakdown and expert answers requires an active subscription.
Coding QuestionsGeneral MotorsRelease Values in Id Order
2/5A coding question on a class that accepts numbered values in arbitrary order and hands them back in id order as soon as the next expected ids are all present. It checks state kept across calls and edge cases around gaps and empty values.
Coding QuestionsBloombergPython Class and Data Structures
2/5Assemble a small container class that keeps a unique collection, returns it in order, exposes hash values, and finds an element by halving the search space. This Anthropic warm-up is really about choosing the right built-in for each operation and knowing what each one costs. You will keep the sorted view consistent with the underlying set, decide when to re-sort, and handle lookups for elements that are not present. The full problem and the model implementation are available to subscribers.
Coding QuestionsAnthropicGraph API: Insert/Configure/Validate with Cycle Detection and Structural Constraints
4/5This architectural design challenge, reported from NVIDIA interviews, requires you to build a robust directed dependency management component supporting node creation, bulk configuration, and rigorous validation. Key responsibilities include cycle detection to prevent deadlocks and verifying valid topological execution sequences. It tests your object-oriented design patterns, graph theory fundamentals, and error handling capabilities. Unlock the full implementation details and reference solution with a subscription.
Coding QuestionsNVIDIASimplified Trie Implementation
3/5Reported as a Dell interview question, this challenge asks you to build a simplified prefix tree data structure that supports word insertion and prefix-based suggestions. The task evaluates your understanding of tree-based string manipulation and efficient retrieval algorithms, requiring you to return a sorted list of top matches for any given query prefix. Mastering this common string-processing pattern and its implementation details requires a full subscription to our coding platform.
Coding QuestionsDell
Studied alongside
Data Structures interview FAQ
- How many Data Structures interview questions are there?
- 20 reported questions, mostly Coding Questions.
- Which companies ask Data Structures questions?
- Apple (4), Google (3), Databricks (2), Goldman Sachs (2), Amazon (2), DoorDash (1), Grammarly (1), General Motors (1).
- How hard are Data Structures questions?
- They average 2.9 out of 5: 4 at 2/5, 15 at 3/5, 1 at 4/5.