# Two-jug measurement problem

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/4904/coding-water-jug-measurement-problem
Source observed: 2026-11-05T00:45:19.390Z
Last checked: 2026-11-05T00:45:19.39+00:00
Indexed: 2026-11-06T17:02:21.9+00:00

---

# Given two empty jugs with capacities *a* and *b* liters and an infinite water supply, determine a way to end up with exactly *X* liters of water.

This is a **Data Structures & Algorithms** and **Coding** interview question for a **Software Engineer**, associated with **Microsoft**. It records **1 interview** and says it was **last asked 2 years ago**.

## Access and answering

Detailed company statistics require an upgrade. You must **log in or sign up to answer**. Submitting an answer marks the question complete.

- [Upgrade](https://www.aced.io/upgrade?src=questions)

## Community answers

No answers have been contributed by the community yet.

## Related courses

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

We prepare candidates for software-engineering roles with mock interviews, frameworks, senior-candidate advice, data structures, algorithms, system design, people management, behavioral interviews, and more.

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

We teach current system-design questions across product, infrastructure, and AI domains through video examples, written breakdowns, reference patterns, and mock-interview demonstrations by senior engineers and managers.

## Page navigation

- [All Questions](https://www.aced.io/questions)
- [Software Engineer questions](https://www.aced.io/questions?role=swe)
- [Microsoft questions](https://www.aced.io/questions?company=microsoft)
- [Data Structures & Algorithms questions](https://www.aced.io/questions?type=algorithms)
- [Coding questions](https://www.aced.io/questions?type=coding)

---

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