InterviewStack.io LogoInterviewStack.io

Arrays and Hash Map Operations Questions

Covers algorithmic patterns that use arrays together with hash based maps or dictionaries to achieve efficient lookup and counting. Topics include frequency counting, duplicate detection, two sum and k sum variants, sliding window with counts, index mapping, grouping by keys, and using hash maps to reduce time complexity from quadratic to linear. Emphasize insertion deletion and lookup costs, collision and memory considerations, trade offs between using hash maps versus sorting or two pointer techniques, and typical interview problem families that rely on combining arrays with associative containers.

HardSystem Design
43 practiced
Design architecture for distributed embedding table lookups and updates across multiple GPUs during model training. Focus on hash-map-like structures mapping sparse feature indices to embedding vectors, consistency of updates across GPUs, memory constraints per GPU, and latency for forward/backward passes. Discuss model-parallel sharding, parameter server patterns, and caching hot embeddings on GPU.
MediumTechnical
44 practiced
Implement 'all_pairs(nums, target)' in Python that returns a list of unique pairs of values (not indices) that sum to target. The input may contain duplicates but output should not include duplicate value pairs. Example: nums=[1,1,2,3,2], target=3 -> [[1,2]]. Use a hashmap to count values and explain handling of (x,x) pairs.
HardSystem Design
35 practiced
Design a system to deduplicate 10 billion text documents (avg 2KB) at ingest time with expected duplicate fraction 5%. Requirements: near-real-time detection (<1s per doc), false positive rate < 1e-6, throughput 50k docs/sec, incremental updates allowed. Describe hashing strategy, sharding, storage choices, collision handling and verification, memory estimates, and fallback strategies.
MediumTechnical
64 practiced
Given an array of event intervals represented as (start, end), compute the maximum number of concurrent events. Implement using a hashmap-based sweep-line that records +1 at start and -1 at end then sweeps sorted keys. Explain time/space trade-offs and how to adapt the approach for streaming workloads with bounded memory.
EasyTechnical
38 practiced
Explain how Python's dict is implemented under the hood: hash table strategy, collision resolution, resizing policy, and the guarantee of insertion-order preservation (Python 3.7+). Discuss why hash collisions can be a security vector and what that implies for services that accept untrusted keys.

Unlock Full Question Bank

Get access to hundreds of Arrays and Hash Map Operations interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.