amazon logo
Amazon路 SDE 2

Amazon OA SDE 2

Result
Ongoing
Location
null
Posted
31 Oct 2025
566 reads

Summary

Attempted Amazon OA SDE 2 with a problem requiring finding the lexicographically smallest sequence meeting specific sum and permutation criteria.

How it went

given two integer size and target sum return the lexicography smallest sequence such that
1. the sum of its element equal to target sum
2. the absolute value of its element form permutation of size size

Example:
size=5, target_sum=9
ans=[-3,1,2,4,5]

Questions asked (1)

  1. 01

    Lexicographically Smallest Sequence with Sum and Permutation Constraints

    Data Structures & Algorithms 路 Hard

    Given two integers, size and target sum, return the lexicographically smallest sequence such that:
    1. The sum of its elements equals the target sum.
    2. The absolute values of its elements form a permutation of size size.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Amazon recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!