Amazon OA - Feb 2025

amazon logo
amazon
SDE III
March 29, 2025 • 5 reads

Summary

I took an Amazon Online Assessment in February 2025 for an L5 role, which included two coding questions, GDS, and behavioral MCQs. While I struggled with one coding question, I still received an invite for the next steps.

Full Experience

Full OA was 2 coding questions + some GDS questions + some behavioural/culture fit questions. (MCQ)

Amazon L5, Feb 2025

Don't really remember Q1, but it was a pretty straightforward question

Here's Q2: Given two strings s and t, return the number of subsequences of s that are lexicographically strictly greater than t, modulo 1e9 + 7.

Example s = "aba" t = "ab" => expected return: 3

 Subsequence of s   |   strictly greater than t?
-------------------------------------------------
    a               |       no
    ab              |       no
    aa              |       no
    aba             |       yes
    b               |       yes
    ba              |       yes
    a               |       no

I came up with a DFS+Memo approach, that keeps track of the index of s and the length of the current subsequence I am pathing, so typically kinda a 2D top down DP, but only passed like 11 or 12 test cases out of 15 (TLE) :( ā€Ž Anyways, still got an invite for next steps the following day. Good luck!

Interview Questions (1)

Q1
Count Lexicographically Greater Subsequences
Data Structures & Algorithms

Given two strings s and t, return the number of subsequences of s that are lexicographically strictly greater than t, modulo 1e9 + 7.

Example s = "aba" t = "ab" => expected return: 3

 Subsequence of s   |   strictly greater than t?
-------------------------------------------------
    a               |       no
    ab              |       no
    aa              |       no
    aba             |       yes
    b               |       yes
    ba              |       yes
    a               |       no
Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

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