Anonymous
const A = [7, 5, 6, 3, 2, 1, 11];
for(let i = 2; i < n; i++) {
A[i - 2] = A[i - 1] * A[i];
}
if(n > 1) A[n - 2] = 0;
if(n > 0) A[n - 1] = 0;
Apple
Roblox
Ubisoft
Rovio
Konami
Texas Instruments
Anonymous
Prepare for success with realistic, role-specific interview simulations.
Try AI Interview NowInterview question asked to Frontend Engineers interviewing at Apple, WeWork, Daybreak Game Company and others: Can you write a function that transforms an array into another where each element is the product of its two subsequent elements?.
Type or paste your answer below and get a strength-o-meter check.
Your answer will be graded on the following metrics: