# In-place merge of two sorted arrays | 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/1117/in-place-merge-two-sorted-arrays
Source observed: 2026-11-04T22:43:16.571Z
Last checked: 2026-11-04T22:43:16.571+00:00
Indexed: 2026-11-05T22:38:29.327+00:00

---

# Implement an in-place merge of two sorted arrays

We provide this coding-interview question in our interview-preparation question library. It asks you to merge two sorted arrays in place.

## Example

`[1,2,5,7,0,0,0]`, `[3,4,6]` ⇒ `[1,2,3,4,5,6,7]`

The first array includes space for the elements from the second array. The expected result is the sorted combined array, produced in place.

## Question details

- **Interview count:** 1 interview
- **Reported last asked:** a year ago
- **Role:** [Software Engineer](https://www.aced.io/questions?role=swe)
- **Company:** [Meta](https://www.aced.io/questions?company=meta-facebook)
- **Categories:** [Data Structures & Algorithms](https://www.aced.io/questions?type=algorithms), [Coding](https://www.aced.io/questions?type=coding)

We offer an upgrade path for detailed company statistics: [Upgrade](https://www.aced.io/upgrade?src=questions).

## Community answers

No answers have been contributed by the community yet.

## Related questions

- [Implement merge-sort](https://www.aced.io/questions/4424/implement-merge-sort)
- [Find the median of two sorted arrays.](https://www.aced.io/questions/4322/median-of-two-sorted-arrays)
- [Count the occurrences of the element in a sorted array.](https://www.aced.io/questions/7343/count-element-occurrences-sorted-array)

## Related courses

### [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)

Our course helps candidates prepare for software engineering roles at Google, Amazon, Microsoft, Meta, Apple, and other top companies. It covers mock interviews, frameworks, advice from senior candidates, data structures, algorithms, system design, people management, behavioral interviews, and more.

### [System Design Interviews](https://www.aced.io/courses/system-design-interviews)

![System Design Interviews](https://images.ctfassets.net/x78yjrjc11pq/78x7miFZFjBCrM5GqftrMJ/2f6d26e632c4e7265c49f6a180227edb/system_design_track_compressed_26ac98a46e__281_29_5be2280f31.jpeg?w=800&h=800&fm=webp&q=75)

Our system-design course covers current system-design questions across product, infrastructure, and AI domains. It includes in-depth video examples, written breakdowns, reference patterns, and mock-interview videos featuring senior engineers and managers.

## Submit an answer

Use the answer area to submit your response. Submitting marks the 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%2F1117%2Fin-place-merge-two-sorted-arrays&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%2F1117%2Fin-place-merge-two-sorted-arrays). Opening a form does not execute a tool.