InterviewStack.io LogoInterviewStack.io

Arrays, Strings & Hashing Questions

Solve problems involving array manipulation, string operations, and hash tables. Common topics include two-pointer techniques, sliding windows, prefix sums, and hash map usage. Practice problems on LeetCode with difficulty 'easy' to 'medium.' Focus on understanding why these data structures are used and what their trade-offs are.

HardSystem Design
37 practiced
Given a large corpus of tokenized sentences, design an algorithm to efficiently find all near-duplicate sentences where 'near' is defined by Jaccard similarity over shingles > T. Explain shingling, minhashing, and hashing choices; detail data structures and complexity to scale to hundreds of millions of sentences.
EasyTechnical
31 practiced
Given an array of integers representing class labels in a dataset, implement a Python function to find the majority element (the element that appears more than ⌊n/2⌋ times). Try to do it in O(n) time and O(1) space. Explain Boyer-Moore Voting Algorithm and when you would use it vs. a hash-counting approach in ML data validation.
MediumTechnical
44 practiced
Given a sorted array of integers (ascending), find two numbers such that they add up to a specific target number. Return the pair of values (not indices). Implement in Python using O(n) time and O(1) extra space via the two-pointer technique. Example: [1,2,3,4,6], target=6 -> (2,4).
EasyTechnical
37 practiced
Implement a function in Python that checks whether a given string is a palindrome, considering only alphanumeric characters and ignoring cases. Example: 'A man, a plan, a canal: Panama' -> True. Explain complexity and how you'd handle large Unicode inputs encountered in production text preprocessing.
MediumTechnical
36 practiced
You have an event stream of (user_id, timestamp) ordered by time. Implement a Python function that returns all user_ids that have more than k events within any sliding window of size T seconds. Provide an approach using hash maps + deque per user to keep O(number of events) amortized time and explain memory considerations in production.

Unlock Full Question Bank

Get access to hundreds of Arrays, Strings & Hashing interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.