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.
HardTechnical
0 practiced
Design a serialization format and algorithm to serialize and deserialize a linked structure that may contain cycles and shared nodes (a general directed graph). Your format must preserve node identity so that shared and cyclic references are reconstructed correctly. Explain traversal order, unique ids, and how to handle very large graphs and security considerations.
EasyTechnical
0 practiced
Implement a Stack using a singly linked list in JavaScript. Provide methods push(value), pop(), peek(), isEmpty(), and size(). Ensure all operations are O(1), handle underflow properly, and include short usage examples.
EasyTechnical
0 practiced
When implementing a linked list in C, describe the pointer-manipulation steps and necessary checks for inserting and deleting nodes safely. Provide short code-like pseudocode for insert after a given node and delete a given node, and discuss common bugs such as dangling pointers, double free, and null dereference. Mention best practices to avoid these issues.
HardTechnical
0 practiced
Reorder a singly linked list to interleave nodes from head and tail in the pattern L0 -> Ln -> L1 -> Ln-1 -> L2 -> Ln-2 ... Implement an in-place algorithm that runs in O(n) time and O(1) extra space. Example: 1->2->3->4->5 becomes 1->5->2->4->3.
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.
Unlock Full Question Bank
Get access to hundreds of Linked Lists Stacks and Queues interview questions and detailed answers.