Panda Guru LogoPanda
Guru

Amazon | SDE Intern 6m | Online Assesment

Round 1

Questions: In the world of Amazon's vast inventory management, you face a challenge of optimizing two inventories, inv1 and inv2, each containing n elements. Your goal is to maximize the similarity between these inventories. The similarity is measured by the number of indices i (0 <= i < n) where inv1[i] equals inv2[i].

Amazon provides a unique tool, the "Inventory Optimizer". This tool allows you to perform the following operation:

Using the Inventory Optimizer, you can perform this operation any number of times (including zero) to maximize the similarity between inv1 and inv2.

Example

n = 3 inv1 = [2, 4, 1] inv2 = [1, 2, 3]

Now, there are two indices, i = 0 and i = 2 for which inv1[i] = inv2[i]. Since it's impossible to make the elements at all indices of the two arrays equal, the answer is 2.

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.