← Adobe Interview Insights

Adobe·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
May 2026

Summary

Adobe SWE interview that went deep into array manipulation and duplicate detection. The follow-up on bounded values is where things got interesting and a little uncomfortable.

Questions Asked (2)

Q1

Given an unsorted integer array, find all duplicate numbers. Walk through the trade-offs between different approaches.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I jumped straight to hash-set because that's the reflex answer and it is fine, O(n) time, O(n) space.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying constraints (e.g., array size, value range, memory limits) and then present multiple approaches with increasing efficiency: brute force, sorting, hash set, and in-place marking. For each, analyze time and space complexity, and discuss trade-offs such as whether the input can be modified or if extra space is allowed.

Pro tip: Mention that if the array values are within a known range (e.g., 1 to n), you can use the array itself as a hash table by marking visited indices, achieving O(n) time and O(1) extra space. This demonstrates deep understanding of space-time trade-offs and often impresses interviewers.

1. Clarify constraints and requirements

Ask about the input size, value range, whether the array can be modified, and memory constraints. This determines which approaches are feasible.

2. Present brute force and sorting approaches

Describe the naive O(n^2) comparison and the O(n log n) sorting method, noting their simplicity but inefficiency for large inputs.

3. Introduce hash-based approach

Explain using a hash set to track seen elements, achieving O(n) time but O(n) extra space. Discuss when this is acceptable.

4. Propose in-place marking for O(1) space

If values are in range 1 to n, use index marking (e.g., negate values or add n) to find duplicates in O(n) time and O(1) extra space, noting it modifies the array.

5. Summarize trade-offs and recommend

Compare time/space complexities, modification of input, and practical considerations. Recommend the best approach based on constraints.

Key Points to Mention

  • Time and space complexity of each approach (brute force, sorting, hash set, in-place marking).
  • Whether the input array can be modified and if extra space is allowed.
  • The assumption that values are in a known range (e.g., 1 to n) for the in-place method.
  • Handling edge cases: empty array, no duplicates, all duplicates, large input.
  • Potential pitfalls: integer overflow when using sum or XOR tricks, and the need to restore the array if modified.
  • Real-world considerations: memory vs. speed trade-offs, and readability vs. optimization.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

If all values are bounded between 1 and 200, what additional approaches open up? Compare bitmask, counting array, and in-place index marking.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This is where I started sweating a little.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the problem context: what operation is needed (e.g., find duplicates, missing numbers, frequency count) and constraints (time, space, mutability). Then compare bitmask, counting array, and in-place index marking in terms of time/space complexity, implementation simplicity, and trade-offs, highlighting when each is optimal given the bounded range 1–200.

Pro tip: Mention that with a small fixed bound like 200, a bitmask of 4 64-bit words is extremely space-efficient and cache-friendly, but if you need frequencies, a counting array is simpler; in-place marking is best when memory is tight and mutation is allowed.

1. Clarify the problem and constraints

Ask what operation is required (e.g., detect duplicates, find missing numbers, count frequencies) and note constraints like time, space, and whether the input can be modified.

2. Analyze bitmask approach

Explain that a bitmask uses one bit per possible value (1–200), requiring only 200 bits (~25 bytes). It supports O(1) set/test operations and is ideal for presence/absence queries, but not for counting frequencies.

3. Analyze counting array approach

Describe using an array of size 201 (or 200) to store frequencies. It uses O(n) extra space but allows O(1) increment and lookup, and is straightforward to implement.

4. Analyze in-place index marking

Explain that if the input array can be mutated, you can use the array itself as a hash table by marking visited indices (e.g., negating values or adding n). This achieves O(1) extra space but modifies input and requires careful handling.

5. Compare and recommend

Summarize trade-offs: bitmask for minimal space and fast presence checks; counting array for frequency counts and simplicity; in-place marking for O(1) space when mutation is allowed. Choose based on the specific problem requirements.

Key Points to Mention

  • Time and space complexity of each approach: bitmask O(n) time, O(1) space (200 bits); counting array O(n) time, O(200) space; in-place marking O(n) time, O(1) space but modifies input.
  • Bitmask is ideal for set membership and can be implemented with bitwise operations on integers or arrays of integers.
  • Counting array is simple and allows frequency queries, but uses more memory than bitmask.
  • In-place marking avoids extra memory but requires the array to be mutable and values to be within a known range; it can be tricky to implement correctly.
  • The bounded range (1–200) makes all three approaches feasible; the choice depends on whether you need counts, whether you can modify input, and memory constraints.
  • Mention that for very small bounds, the constant factors matter: bitmask operations are fast and cache-friendly, but counting array may be faster for small n due to simplicity.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.