InterviewStack.io LogoInterviewStack.io

Linked Lists Stacks and Queues Questions

Covers core singly and doubly linked list concepts and the fundamental abstract data types stack and queue. For linked lists this includes node structure, traversal, insertion at head and tail, deletion, reversal, finding middle, merging, detecting cycles, removing duplicates, intersection detection, and pointer manipulation details for languages with manual memory management. For stacks and queues this includes LIFO and FIFO semantics, push, pop, peek, enqueue, dequeue, circular buffer implementations, and implementing one with the other (for example queue with two stacks). Also includes array versus linked list implementations, complexity analysis for time and space, and common algorithmic patterns that use these structures (for example bracket matching, reverse polish notation evaluation, depth first search using a stack, breadth first search using a queue, sliding window and monotonic queue techniques). Interviewers assess correct implementation, edge case handling, performance tradeoffs, and ability to choose the appropriate structure or approach for a problem.

EasyTechnical
0 practiced
Given a string containing parentheses and bracket characters such as '(', ')', '{', '}', '[' and ']', implement a function isBalanced(s) in Python that returns true if the input is balanced and false otherwise. Include sample inputs such as '([]){}' -> true and '([)]' -> false. Describe complexity and common edge cases.
MediumTechnical
0 practiced
Remove duplicates from an unsorted singly linked list. Implement two solutions: one using a hash set for O(n) time and O(n) space, and one without extra space that runs in O(n^2) time. Provide code and discuss when each approach is preferable in production systems.
HardTechnical
0 practiced
You have a very large singly linked list stored on disk in node-sized blocks that do not fit in memory. Design an algorithm to find the middle element while minimizing disk I/O. Discuss block-based strategies, scanning passes, and tradeoffs vs streaming. Assume sequential read of disk blocks is efficient but random seeks are expensive.
MediumTechnical
0 practiced
Implement iterative depth-first search for a graph using an explicit stack (no recursion). Show code for visiting nodes in DFS order given an adjacency list and discuss differences in stack-driven DFS vs recursive DFS in terms of space, tail recursion, and control over traversal order.
MediumTechnical
0 practiced
Write a function that merges two sorted singly linked lists into a single sorted list in-place without allocating new nodes. Provide code (Python or Java), discuss iterative vs recursive approaches, and analyze time and space complexity. Mention how you would merge k sorted lists efficiently.

Unlock Full Question Bank

Get access to hundreds of Linked Lists Stacks and Queues interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.

Linked Lists Stacks and Queues Interview Questions | InterviewStack