Question bank › Two Pointers
Dsa Two Pointers Easy

Subarray Product

You are given an array of positive integers. Your task is to determine the maximum product of any contiguous subarray. Print the maximum product found. Input Format: - A single line containing positive integers separated by spaces. Output Format: - A single integer representing the maximum product of a contiguous subarray. Example: Input: 1 2 3 4 Output: 24

Key concepts

two_pointersarrayssliding_window

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.