InterviewStack.io LogoInterviewStack.io

Array and String Manipulation Questions

Comprehensive coverage of language level operations and algorithmic techniques for arrays and strings that are commonly evaluated in coding interviews. Candidates should understand common language methods for arrays and strings, including their parameters and return values, chaining of operations, and the implications of mutable versus immutable types for in place versus extra space solutions. Core algorithmic patterns include iteration and traversal, index based and pointer based approaches, two pointer strategies, sliding window, prefix and suffix sums, sorting and partitioning, and cumulative or running sums. Problem classes include traversal, insertion and deletion, reversing and rotating, merging and deduplicating, subarray and substring search, anagram detection, palindrome detection, longest substring and maximum subarray problems, and pointer based reordering and partitioning tasks. Pattern matching techniques include naive matching, Knuth Morris Pratt and rolling hash approaches, and hashing for frequency and membership checks. String transformation and comparison topics include edit distance, sequence transformation problems such as word ladder, and parsing and validation tasks. Candidates should be prepared to implement correct and efficient solutions in common programming languages, reason about time and space complexity, optimize for input size and memory constraints, handle edge cases such as empty inputs and boundary conditions, and address character level concerns such as encoding differences, multibyte characters, surrogate pairs and unicode normalization. Interviewers may probe language specific implementation details, in place mutation versus copying, fixed buffer strategies, streaming or incremental algorithms for large inputs, and trade offs between clarity and performance. Expect questions that require selecting the right algorithmic pattern, implementing a robust solution, and justifying complexity and memory decisions.

HardTechnical
47 practiced
Explain Unicode normalization forms (NFC, NFD) and implement a mobile-safe comparator that returns true if two user-visible strings are equivalent after normalization. Describe platform APIs in iOS/Swift and Android/Java for normalization and explain performance considerations when normalizing many strings.
HardTechnical
65 practiced
Given an NxN image represented as a 2D array of bytes (or ints) in Kotlin, implement an in-place 90-degree rotation of the image. Signature: fun rotateImage(matrix: Array<IntArray>): Unit. Optimize for cache locality and low allocations on mobile GPUs/CPUs, and describe how to handle large images that don't fully fit in cache.
HardTechnical
91 practiced
Find the median of two sorted arrays in O(log(min(m,n))) time. Implement the algorithm in Kotlin and explain edge cases. Discuss why this algorithm is appropriate (or not) for mobile apps that need to combine sorted feeds from multiple sensors or data sources.
EasyTechnical
62 practiced
Write a function in Kotlin that reverses a mutable character array in place. Signature: fun reverseInPlace(s: CharArray): Unit. Constraints: O(n) time and O(1) extra space. Explain how Kotlin String immutability affects your approach if the input were a String instead of a CharArray. On Android, how would you avoid extra memory allocations for very large strings received from I/O (e.g., large text files) when reversing?
EasyTechnical
63 practiced
Implement a React Native / JavaScript function to merge and deduplicate two arrays of strings while preserving original relative order for the first occurrence across both arrays. Signature: function mergeDedup(a: string[], b: string[]): string[]. Explain time/space complexity and how to minimize memory churn in a JS bridge on mobile devices.

Unlock Full Question Bank

Get access to hundreds of Array and String Manipulation interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.