PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Coding & Algorithms/Amazon

Determine max remainders and anagram after deletions

Last updated: Mar 29, 2026

Quick Overview

In the Coding & Algorithms domain, this two-part question evaluates modular arithmetic and combinatorial reasoning for maximizing distinct array remainders and frequency-vector manipulation for determining anagram feasibility after selective character deletions, while also testing algorithm design and time/space complexity analysis.

  • Medium
  • Amazon
  • Coding & Algorithms
  • Software Engineer

Determine max remainders and anagram after deletions

Company: Amazon

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

Part 1 (Array Remainders): Given an integer array A of length n with A[i] > 0. You may choose any integer array B of length n. Define C[i] = B[i] mod A[i] for 0 ≤ i < n. What is the maximum possible number of distinct values in C? Describe an efficient algorithm to compute this maximum for a given A and provide time/space complexities. Part 2 (String Similarity by Deleting One Letter Type): Given two lowercase strings s and t. In each string, you may select one letter (possibly a different letter in each string) and delete any number of occurrences of that letter (including zero). After these deletions, can s and t become anagrams (i.e., have identical letter-frequency vectors)? Design an algorithm to decide this and analyze its complexity.

Quick Answer: In the Coding & Algorithms domain, this two-part question evaluates modular arithmetic and combinatorial reasoning for maximizing distinct array remainders and frequency-vector manipulation for determining anagram feasibility after selective character deletions, while also testing algorithm design and time/space complexity analysis.

Related Interview Questions

  • Count Connected Components in an Undirected Graph - Amazon (medium)
  • Find Unique Target-Sum Pairs - Amazon (easy)
  • Find Valid IP Addresses in Files - Amazon (medium)
  • Implement Optimal Bucket Batching - Amazon (hard)
  • Implement Cache and Rotate Matrix - Amazon (medium)
Amazon logo
Amazon
Sep 6, 2025, 12:00 AM
Software Engineer
Take-home Project
Coding & Algorithms
2
0

Part 1 (Array Remainders): Given an integer array A of length n with A[i] > 0. You may choose any integer array B of length n. Define C[i] = B[i] mod A[i] for 0 ≤ i < n. What is the maximum possible number of distinct values in C? Describe an efficient algorithm to compute this maximum for a given A and provide time/space complexities. Part 2 (String Similarity by Deleting One Letter Type): Given two lowercase strings s and t. In each string, you may select one letter (possibly a different letter in each string) and delete any number of occurrences of that letter (including zero). After these deletions, can s and t become anagrams (i.e., have identical letter-frequency vectors)? Design an algorithm to decide this and analyze its complexity.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Amazon•More Software Engineer•Amazon Software Engineer•Amazon Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.