← Questions

Rearrange an array so positive and negative numbers alternate

0
TeslaCodingLast asked Aug 2026

A coding interview question asked in Tesla's second technical round, last asked Aug 2026. It tests arrays and two pointers.

Given an integer array that holds both positive and negative values, reorder it so that the signs alternate. Before coding, agree on the details the problem leaves open: which sign comes first, whether the original relative order inside…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

arrays · two pointers

Your code and the AI tutor open when you unlock this question.