# Unique number in an array in O(log n) time | Aced

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/3804/find-unique-number-array-logn-time
Source observed: 2026-11-05T00:02:41.798Z
Last checked: 2026-11-05T00:02:41.798+00:00
Indexed: 2026-11-06T18:38:01.013+00:00

---

# Given an array of numbers where every number occurs twice except one, how would you find the unique number in O(log n) time?

We publish interview-practice questions for software and machine-learning candidates. This coding question concerns finding the one unpaired number in an array in logarithmic time.

[All Questions](https://www.aced.io/questions)

## Question details

- **Reported interviews:** 2
- **Category:** [Coding](https://www.aced.io/questions?type=coding)
- **Roles:** [Machine Learning Engineer](https://www.aced.io/questions?role=ml-engineer), [Software Engineer](https://www.aced.io/questions?role=swe)
- **Company:** [Meta](https://www.aced.io/questions?company=meta-facebook)
- **Save:** 39 saves are shown.

Detailed company statistics are available through [Upgrade](https://www.aced.io/upgrade?src=questions).

## Interview experiences

One interview experience is shared for this question.

### Meta · 8 months ago

This **customer-submitted interview experience** is attributed to Meta. The contributor described the process as rigorous and comprehensive, with recruiter guidance that was accurate and helpful. They found the interviewers professional and respectful and said the process assessed technical depth and practical problem-solving. The contributor discussed experience, research background, and problem-solving approach, while finding some questions difficult under time pressure when connecting fundamentals, implementation details, and communication.

- **Role:** Machine Learning Engineer
- **Level:** Mid Level / L4
- [Read the full Meta machine-learning-engineer interview experience](https://www.aced.io/experiences/meta-facebook-machine-learning-engineer-interview-b70d65)

## Community answers

No community answers have been contributed yet. To submit an answer, [log in or sign up](https://www.aced.io/signup?src=nav&returnPath=/questions/3804/find-unique-number-array-logn-time). Submitting marks the question complete.

## Related question

- [Find the first or last occurrence of a given number in a sorted array.](https://www.aced.io/questions/1140/find-first-last-occurrence-given-number-sorted-array)

## 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. Topics include ML system design, core concepts, coding, and behavioral interviews.

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

![Software Engineering Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/4VkuYewBHUFIVUS5oJDW5h/02e833439b1289f25f38f13f81cbdca3/adobe_stock_optimized.jpeg?w=800&h=800&fm=webp&q=75)

We help candidates prepare for software-engineering roles at Google, Amazon, Microsoft, Meta, Apple, and other companies. Topics include data structures, algorithms, system design, people management, and behavioral interviews, with mock interviews, frameworks, and advice from senior candidates.

## Explore Aced

Aced, formerly Exponent, offers interview courses and practice resources, including:

- [Courses](https://www.aced.io/courses?src=nav)
- [Loops](https://www.aced.io/guides?src=nav)
- [Experiences](https://www.aced.io/experiences?src=nav)
- [Questions](https://www.aced.io/questions?src=nav)
- [Practice](https://www.aced.io/practice?src=nav)
- [Coaching](https://www.aced.io/coaching?src=nav)
- [Pricing](https://www.aced.io/upgrade?src=nav)
- [Job Referrals](https://www.aced.io/jobs/referrals?src=nav)
- [Blog](https://www.aced.io/blog?src=nav)
- [Resources](https://www.aced.io/resources?src=nav)
- [For universities](https://www.aced.io/pages/university?src=nav)
- [For businesses](https://www.aced.io/pages/business?src=nav)
- [For recruiters](https://www.aced.io/jobs/post?src=nav)

Our course categories include Product Management, Forward Deployed, Engineering Management, Software Engineering, System Design, Data Science, Machine Learning, Data Engineering, AI Engineering, Investment Banking, Generative AI, Security Engineer, TPM, Solutions Architect, UX / Product Design, and BizOps & Strategy. We also provide [Mock Interviews & Coaching](https://www.aced.io/coaching?category=mock_interviews&src=nav), [Resume Review](https://www.aced.io/resume?src=nav), and [Salary Negotiation](https://www.aced.io/coaching?category=negotiation&src=nav).

## Your answer

Use the answer form to submit a response. You must [log in or sign up](https://www.aced.io/login?src=nav) before answering.

---

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