# Array duplicate detection 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/965/check-duplicates-in-array-constant-space
Source observed: 2026-11-05T00:44:49.091Z
Last checked: 2026-11-05T00:44:49.091+00:00
Indexed: 2026-11-06T16:09:50.688+00:00

---

# Determine if an array of integers from 1 to n contains a duplicate in constant time and space

We provide this interview-practice question through Aced, formerly Exponent. It concerns detecting whether an array whose values range from 1 to `n` contains a duplicate, subject to constant-time and constant-space requirements.

## Interview details

- **Category:** [Data Structures & Algorithms](https://www.aced.io/questions?type=algorithms)
- **Also categorized as:** [Coding](https://www.aced.io/questions?type=coding)
- **Roles:** [Data Engineer](https://www.aced.io/questions?role=data-engineer), [Machine Learning Engineer](https://www.aced.io/questions?role=ml-engineer)
- **Companies:** [Apple](https://www.aced.io/questions?company=apple), [Adobe](https://www.aced.io/questions?company=adobe), [Microsoft](https://www.aced.io/questions?company=microsoft)
- **Reported last asked:** 2 years ago
- **Interview records:** 3

## Community answers

No answers have been contributed by the community yet. To submit an answer, log in or sign up; submitting marks the question complete.

## Related questions

- [Given an array of integers, find the first duplicate.](https://www.aced.io/questions/7443/find-first-duplicate-array-integers)
- [Write a function that takes an array of integers and checks for duplicate values in any contiguous window of size N.](https://www.aced.io/questions/4245/check-duplicate-values-contiguous-window)

## 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 cover mock interviews, frameworks, and advice from senior candidates for machine-learning roles at Meta, Google, Amazon, Apple, Microsoft, Nvidia, and other companies. Topics include ML system design, core concepts, coding, and behavioral interviews.

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

![Data Engineering Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/5XoOCgXlGqN2fa1zaroNWd/9a2e23df48a212bc00d352873feb2d6a/Data_Engineer_Interview_Prep_Hero_Image.jpg?w=800&h=800&fm=webp&q=75)

We cover mock interviews, frameworks, and advice from senior candidates for data-engineering roles at Meta, Google, Amazon, Microsoft, Walmart, DoorDash, and other companies. Topics include data modeling, pipeline design, SQL, coding, and behavioral interviews.

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F965%2Fcheck-duplicates-in-array-constant-space&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%2F965%2Fcheck-duplicates-in-array-constant-space). Opening a form does not execute a tool.