Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Leetcode 152. Maximum Product Subarray
Find the contiguous subarray with the largest product in an integer array; because negatives and zeros can flip signs, you must track both the running maximum and minimum products at each step to correctly handle sign changes.
Asked at:
Microsoft
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Mid November, 2025
Mid-level
Follow up 152
Mid November, 2025
Microsoft
Mid-level
Given an integer array nums, find a subarray that has the largest product, and return the product. The test cases are generated so that the answer will fit in a 32-bit integer. Note that the product of an array with a single element is the value of that element.
Mid September, 2025
Senior
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.