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.

HardTechnical
59 practiced
Implement MinHash for estimating Jaccard similarity between documents constructed from k-shingles (substrings of length k). Provide functions to compute shingles, generate multiple hash signatures, and estimate similarity. Discuss how many permutations (signature size) are needed to achieve a given variance in estimate and how MinHash is used in large-scale near-duplicate detection.
EasyTechnical
44 practiced
You have a list of integer feature indices representing nonzero positions in a sparse feature vector. Given an array nums and an integer target, implement a Python function that returns indices of two numbers such that they add up to target. Assume exactly one solution exists and you cannot use the same element twice. Provide time and space complexity and mention how this applies to matching features in embedding spaces.
EasyTechnical
43 practiced
Implement a function to compute the maximum sum of any contiguous subarray with fixed length k in an integer array. Use Python and O(n) time. Explain how sliding window optimization reduces redundant computation compared to naive approach, and mention use cases in moving-average feature computation.
EasyTechnical
36 practiced
As an AI Engineer you often manipulate flattened tensors stored as 1D arrays. Implement a Python function that reverses an integer array in-place (O(1) extra space) and returns the array. Do not use built-in reverse functions or slicing. Example: input = [1, 2, 3, 4], output = [4, 3, 2, 1]. Explain time and space complexity and how this pattern helps when reshaping tensor data on GPU memory.
MediumTechnical
30 practiced
Longest Palindromic Substring: Implement a Python function that returns the longest palindromic substring of a given string. Use the expand-around-center approach for simplicity (O(n^2) time) and discuss the Manacher algorithm for O(n) time as a follow-up. Mention NLP use-cases where palindrome detection might matter.

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.