Amazon
Amazon

Software Development Engineer 1

Row with Maximum Number of 1s

Medium
Round 1 (December)CodingCandidate Selected

Given a binary matrix, identify the row that has the maximum number of 1s. The initial approach involves applying binary search on every row with a time complexity of O(m log n). An optimized solution starts from the top-right corner of the matrix. If the current value is 1, move left; if 0, move down. Keep track of the row whenever moving left. The final time complexity is O(m + n) and space complexity is O(1).

This question was asked in

Amazon Software Development Engineer 1 Interview Experience

The Amazon interview process consisted of three rounds, featuring a mix of coding, behavioral, and system design questions. Candidates can expect technical questions related to Binary Search and Dynamic Programming in the first two rounds, followed by discussions on project experience and Leadership Principles in the final round. Overall, the interview experience at Amazon appears to be challenging and comprehensive, testing both technical and behavioral competencies.

AI Powered

Share Your Story

Share your interview in your own words — our AI handles the rest. Hardly takes 2 minutes.

Take Mock Interview

Prepare better with expert feedback

Want to Connect 1:1?

Connect with me 1:1 for career guidance, resume reviews, interviews, and more.

Show Your Love!

Connect with us on social media