Question bank › Two Pointers
Dsa Two Pointers Medium

Subarray Product Less Than K

You are given an array of positive integers and an integer k. Your goal is to find the number of contiguous subarrays where the product of all the elements in the subarray is less than k. A subarray is defined by a starting index and an ending index. Example: Input: 3 5 2 6 10 Output: 8

Key concepts

two_pointerssubarrayproduct

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.