Amazon OA - Feb 2025
- Posted
- 29 Mar 2025
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.
How it went
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!
Questions asked (1)
- 01
Count Lexicographically Greater Subsequences
Data Structures & Algorithms
Given two strings
sandt, return the number of subsequences ofsthat are lexicographically strictly greater thant, modulo1e9 + 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