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.
EasyTechnical
53 practiced
Implement basic run-length encoding (RLE) for compressing simple log sequences. Given a string s of characters, return its RLE as counts followed by the character (e.g., 'aaabcc' -> '3a1b2c'). Provide a Python function `rle_encode(s: str) -> str` and `rle_decode(encoded: str) -> str`. State time/space complexity and where this is useful in ETL.
HardSystem Design
36 practiced
Design a deduplication pipeline for streaming events at scale. Requirements: handle billions of unique IDs per day, support near-real-time detection with low memory footprint, tolerate false positives at a configurable small rate, and allow eventual exact deduplication for downstream analytics. Discuss components, use of hashing, Bloom filters, partitioning, state stores, and how you'd ensure idempotent processing.
HardSystem Design
41 practiced
Design a system to detect near-duplicate documents at scale (e.g., web pages or long log messages) using MinHash and Locality-Sensitive Hashing (LSH). Describe how you would convert documents to sets (e.g., shingles), compute MinHash signatures, use LSH for candidate generation, tune banding parameters for precision/recall, and handle clustering/final verification at scale.
EasyTechnical
38 practiced
While compacting a sorted shard of event timestamps you need to remove duplicate entries in-place to reduce storage. Given a sorted integer array nums, write a Python function to remove duplicates in-place such that each unique element appears only once and return the new length. Do not allocate extra array space; use O(1) extra memory. Example: nums = [1,1,2] -> return length 2 and nums becomes [1,2,_].
EasyTechnical
43 practiced
Data pipeline step: reverse the order of words while preserving whitespace and punctuation in log entries. Implement `reverse_words(s: str) -> str` in Python that returns a string with word order reversed (words are sequences of non-space characters). Example: s = ' alice in wonderland ' -> 'wonderland in alice'. Discuss edge cases and O(1) extra space strategies if the string is mutable.
Unlock Full Question Bank
Get access to hundreds of Arrays, Strings & Hashing interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.