Arrays, Strings, and Linked Lists Mastery Questions
Foundational data structures: arrays, strings, and linked lists. Covers core operations (insertion, deletion, traversal, searching), pattern usage, edge cases, and time/space complexity analysis, with a focus on practical implementation and common interview-style problems across mainstream programming languages.
HardTechnical
48 practiced
Describe and sketch an implementation of a lock-free singly linked list that supports concurrent insert(value), remove(value), and find(value) using atomic compare-and-swap (CAS). Discuss memory reclamation strategies (hazard pointers, epoch-based reclamation), the ABA problem, correctness criteria such as linearizability, and performance trade-offs compared to coarse-grained locking.
HardTechnical
31 practiced
Implement editDistance(word1, word2) in Python to compute the Levenshtein distance (minimum insertions, deletions, substitutions to transform word1 into word2). Provide O(n*m) time and O(min(n,m)) space optimized DP implementation and describe how to reconstruct an edit sequence from full DP table if required.
HardTechnical
27 practiced
Implement minCut(s) in Python that returns the minimum number of cuts needed to partition string s so that every substring is a palindrome. Provide an O(n^2) time solution by precomputing palindrome table and using dynamic programming to compute minimum cuts, and discuss optimizations to reduce constant factors and memory footprint.
EasyTechnical
23 practiced
Given a sorted integer array nums, implement removeDuplicates(nums) in Java to remove duplicates in-place such that each element appears only once and return the new length. You may not allocate extra arrays and should use O(1) extra space. Example: Input: nums = [0,0,1,1,1,2] -> return length 3 and nums modified to [0,1,2,...]. Discuss behavior for empty arrays and arrays with no duplicates and analyze complexity.
MediumTechnical
33 practiced
Given an array of k sorted linked lists, implement mergeKLists(lists) in Java to merge them into one sorted linked list. Discuss possible approaches: iteratively merging pairs, divide-and-conquer, and using a min-heap (priority queue). Analyze time and space complexity of each approach and choose the best for large k.
Unlock Full Question Bank
Get access to hundreds of Arrays, Strings, and Linked Lists Mastery interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.