InterviewStack.io LogoInterviewStack.io

Arrays, Strings, and Hashing Questions

Manipulating arrays and strings using the standard toolkit for entry-level coding-interview problems: two-pointer and sliding-window techniques, in-place modification (reversal, rotation, partitioning, deduplication), prefix sums, and hash-map or hash-set based techniques used to solve array or string problems in optimal time (frequency counting, lookup-based pairing such as two-sum, duplicate detection, grouping by a computed key such as anagram grouping). Hashing appears in this topic only as an applied technique for solving an array or string problem faster: how hash tables work internally (hash functions, collision resolution, load factor, resizing) and hash-based structures that are not array or string shaped (Bloom filters, HyperLogLog) belong to the separate hashing and hash tables topic, not this one. Covers the most frequent entry-level coding-interview problem shapes and the trade-offs between time, space, and readability. The default warm-up surface for any coding interview.

MediumTechnical
41 practiced

You receive a log line in this format (single line):

2025-12-06T12:00:00Z service=auth pid=1234 level=ERROR msg='Failed login for user bob: invalid password'

Write a Python parser that extracts timestamp, service, pid (int), level, and msg into a dict. Handle missing or quoted messages safely. Discuss performance considerations when parsing millions of lines per hour.

EasyTechnical
39 practiced

Implement remove_element(nums, val) in-place in Python or Java: remove all occurrences of val from nums and return the new length. This is part of a backend cleanup job where payload arrays must be compacted before storage. Explain how to move elements and whether order must be preserved.

HardTechnical
37 practiced

Given an array of integers, implement an algorithm to find all unique triplets that sum to zero (3-sum). Use lists and dictionaries where appropriate, aim to avoid duplicate triplets in the output, and explain time complexity. Provide Python code for the standard O(n^2) approach.

HardTechnical
38 practiced

For heavy-duty string processing in pandas, compare performance of using python loops (apply), pandas vectorized Series.str methods, and numpy.char functions. Given a 10M-row DataFrame, explain how you'd measure and optimize a tokenization pipeline for speed and memory.

MediumTechnical
39 practiced

Given an integer array (may contain negatives) and an integer k, implement a Python function that counts the number of contiguous subarrays whose sum equals k. Provide an O(n) time solution using prefix sums and a hashmap. Explain memory usage and how to handle very large integer sums safely.

Unlock Full Question Bank

Get access to all Arrays, Strings, and Hashing interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.