Question bank › Arrays
Dsa Arrays Medium

Maximize Product of Non-Adjacent Elements

Given an array of integers, find the maximum product you can obtain by multiplying the numbers of an array such that no two numbers are adjacent in the original array. Input Format: - The first line contains an integer N (the number of elements in the array). - The second line contains N space-separated integers representing the elements of the array. Output Format: - Print a single integer representing the maximum product of non-adjacent elements. Example: Input: 5 3 2 5 10 7 Output: 15

Key concepts

arraysdynamic programminggreedy

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.