# Given an array of integers, print all subarrays that sum to zero.

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/964/subarrays-with-zero-sum
Source observed: 2026-11-05T00:29:19.473Z
Last checked: 2026-11-05T00:29:19.473+00:00
Indexed: 2026-11-07T02:09:01.429+00:00

---

# Given an array of integers, print all subarrays that sum to zero.

We host this coding-interview question in our [Questions](https://www.aced.io/questions) library. It asks you to print every contiguous subarray of an integer array whose elements sum to zero.

## Interview context

- **Company:** [Meta](https://www.aced.io/questions?company=meta-facebook)
- **Category:** [Data Structures & Algorithms](https://www.aced.io/questions?type=algorithms)
- **Additional categories:** [Coding](https://www.aced.io/questions?type=coding), [Data Analysis](https://www.aced.io/questions?type=data-analysis)
- **Interview count shown:** 1
- **Reported last asked:** 5 years ago

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

## Community answers

No answers have been contributed by the community yet. To answer, [log in or sign up](https://www.aced.io/signup?src=nav&returnPath=/questions/964/subarrays-with-zero-sum); submitting an answer marks the question complete.

## Related questions

- [Given an array of integers and an integer k, find the number of continuous subarrays whose sum equals k.](https://www.aced.io/questions/7255/find-subarrays-sum-equals-k)
- [Given an array of integers, find a tuple of three integers that can form a triangle.](https://www.aced.io/questions/3403/find-triangle-tuple-in-array)
- [Given an array of integers, find the first duplicate.](https://www.aced.io/questions/7443/find-first-duplicate-array-integers)

## What we offer

Aced, formerly Exponent, provides interview preparation through courses, question practice, interview loops, experiences, and coaching. Our listed course areas 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 offer mock interviews and coaching, resume review, salary negotiation, job referrals, resources, and related services.

- [Courses](https://www.aced.io/courses?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)
- [Aced home](https://www.aced.io/?src=nav)

---

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