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
Implement a function to reverse a singly linked list in-place (iterative). Provide code in Python or C++ and explain edge cases: empty list, single-node list, and how you ensure O(1) extra memory.
EasyTechnical
0 practiced
Implement a function to evaluate a Reverse Polish Notation (postfix) expression containing integers and operators (+,-,*,/). Use a stack and return the integer result. Provide code in Python and include error handling for malformed expressions.
HardTechnical
0 practiced
In a language with manual memory management (C/C++), implement safe deletion of a node from a doubly linked list given a pointer to that node. Discuss handling of dangling pointers, double-free, and how to make this robust in the presence of concurrent readers (without garbage collection).
MediumTechnical
0 practiced
Design and implement an LRU cache that stores model artifacts (small objects) with O(1) get and put. Use a hash map + doubly linked list approach. Provide API (get(key), put(key, value)) and explain how you would adapt it for thread-safety in a multi-threaded inference server.
MediumTechnical
0 practiced
Given a long stream of tokens that must be windowed for online feature extraction, explain how you would implement efficient sliding-window counts (or maxima/minima) using appropriate queue(s), and how to evict old elements, handle out-of-order arrivals, and memory bounds.

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.