# Sort Colors — Coding Interview Question

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/4677/sort-colors
Source observed: 2026-11-04T23:28:12.809Z
Last checked: 2026-11-04T23:28:12.809+00:00
Indexed: 2026-11-05T08:00:03.185+00:00

---

# Sort Colors

We provide this **Data Structures & Algorithms** coding interview question for practice. The task is to sort an array `nums` containing `n` elements—red, white, or blue—in place, grouping equal colors and ordering them as red, white, then blue.

## Question details

- **Category:** [Data Structures & Algorithms](https://www.aced.io/questions?type=algorithms)
- **Reported interviews:** 5
- **Last asked:** 6 months ago
- **Roles:** [Software Engineer](https://www.aced.io/questions?role=swe), [Machine Learning Engineer](https://www.aced.io/questions?role=ml-engineer), [Data Scientist](https://www.aced.io/questions?role=data-science), [Data Engineer](https://www.aced.io/questions?role=data-engineer)
- **Companies:** [Capital One](https://www.aced.io/questions?company=capital-one), [Intel](https://www.aced.io/questions?company=intel), [Nvidia](https://www.aced.io/questions?company=nvidia), [Adobe](https://www.aced.io/questions?company=adobe), [Salesforce](https://www.aced.io/questions?company=salesforce)

## Interview experiences

One interview experience is shared:

- **Capital One · 6 months ago** — “Barely gotten experience with system design interviews, that one threw me off my game and after it I got the business case. I was too nervous after the system design interview that I fumbled both”
- **Role:** Software Engineer · Senior / L5
- [Read the interview experience](https://www.aced.io/experiences/capital-one-senior-software-engineer-interview-7a64af)

## Community answers

No answers have been contributed by the community yet.

## Related question

- [Cyclic Sort](https://www.aced.io/questions/7334/explain-cyclic-sort-algorithm)

## Related courses

### [Machine Learning Engineer Interview Prep](https://www.aced.io/courses/ml-engineer)

![Machine Learning Engineer Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/6UfkHxUyLQVfDHSfLNQtWa/1be1539a65b4f6f15201f5b573c0a578/ML_Engineer_Interview_Prep_Course.jpeg?w=800&h=800&fm=webp&q=75)

We help candidates prepare for machine learning roles at Meta, Google, Amazon, Apple, Microsoft, Nvidia, and other companies through mock interviews, frameworks, and advice from senior candidates. The course covers ML system design, core concepts, coding, behavioral interviews, and more.

### [Data Science Interview Prep](https://www.aced.io/courses/data-science)

![Data Science Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/3U4C5C0OkDR0UeGch4AmlE/7ad489430b676a088cb973307fe77884/Data_Science_Interview_Prep_Course.jpeg?w=800&h=800&fm=webp&q=75)

We help candidates prepare for data science roles at Google, Amazon, Microsoft, Meta, Apple, and other companies. The course includes statistics, experimentation, coding, SQL, machine learning, behavioral interviews, mock interviews, frameworks, and advice from senior candidates.

## Access and response

- [Upgrade to unlock detailed company statistics for this question](https://www.aced.io/upgrade?src=questions)
- Submitting an answer marks this question complete.

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F4677%2Fsort-colors&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F4677%2Fsort-colors). Opening a form does not execute a tool.