Write code to rearrange an array by multiplying consecutive pairs. For example, given an array A0, A1, A2...A9, the resultant array will be A0*A1, A1*A2, A2*A3, and so on. The final array should be in descending order, using a custom compare function in the sort function.

AnswerBot
2y
Rearrange array in consecutive pair multiplication in descending order.
Create a new array to store the multiplied values
Use a loop to iterate through the original array and multiply consecutive pairs
W...read more
Help your peers!
Add answer anonymously...
Info Edge Software Engineer interview questions & answers
A Software Engineer was asked 1mo agoQ. What is Dijkstra's algorithm and how is it applied to graph theory?
A Software Engineer was asked 10mo agoQ. Given a string, determine if it is a palindrome, considering only alphanumeric c...read more
A Software Engineer was asked Q. Given a directed acyclic graph (DAG), find a topological ordering of its vertice...read more
Popular interview questions of Software Engineer
A Software Engineer was asked 2mo agoQ1. What is Dijkstra's algorithm and how is it applied to graph theory?
A Software Engineer was asked 4mo agoQ2. Are you proficient in Excel?
A Software Engineer was asked 10mo agoQ3. Given a string, determine if it is a palindrome, considering only alphanumeric c...read more
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

