# Closest-pair distance question | 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/4630/closest-pair
Source observed: 2026-11-05T00:41:44.043Z
Last checked: 2026-11-05T00:41:44.043+00:00
Indexed: 2026-11-07T02:38:05.081+00:00

---

# Given an array of points on a plane (x,y), write a function to return the distance between the closest pair of points.

Aced, formerly Exponent, provides interview-preparation courses, practice questions, interview loops, experiences, and coaching for technology roles. This page is a coding interview question about finding the minimum Euclidean distance between any two points in a two-dimensional array of points. The question is associated with a Machine Learning Engineer role, Visa, and the Data Structures & Algorithms and Coding categories.

## Question details

- **Interview category:** Data Structures & Algorithms
- **Role:** [Machine Learning Engineer](https://www.aced.io/questions?role=ml-engineer)
- **Company:** [Visa](https://www.aced.io/questions?company=visa)
- **Additional category:** [Coding](https://www.aced.io/questions?type=coding)
- **Reported last asked:** 2 years ago
- **Interview data:** 1 interview

The question asks you to write a function that receives an array of planar points, represented as `(x, y)`, and returns the distance between the closest pair. No input example, output example, constraints, expected programming language, or solution is included in the supplied content.

## Access and answering

Detailed company statistics for this question require an [Upgrade](https://www.aced.io/upgrade?src=questions). To submit an answer, you must [log in or sign up](https://www.aced.io/signup?src=nav&returnPath=/questions/4630/closest-pair). Submitting marks the question complete.

## Community answers

No answers have been contributed by the community yet.

## Related questions

- [Given an array of points and a point P, find the k closest points to P.](https://www.aced.io/questions/4289/find-k-closest-points-array)
- [Given a list of conversion items between symbols, write an algorithm to return the conversion ratio for each pair of symbols.](https://www.aced.io/questions/2275/conversion-ratio-symbols)
- [Given an array of integers, return the pairs with the minimum absolute difference between them.](https://www.aced.io/questions/5443/coding-array-pairs-minimum-difference)

## 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 interviews at Meta, Google, Amazon, Apple, Microsoft, Nvidia, and other top companies. The course includes ML system design, core concepts, coding, and behavioral interviews.

### [Behavioral Interviews: A Practical Guide for Engineers](https://www.aced.io/courses/eng-behavioral)

![Behavioral Interviews: A Practical Guide for Engineers](https://images.ctfassets.net/x78yjrjc11pq/47qcoHjzFZXE37GoacedkB/9d8e3f4910d8b06b21e76745cd9cbff3/AdobeStock_1142146335.jpeg?w=800&h=800&fm=webp&q=75)

We provide preparation for senior-plus behavioral interviews at FAANG and Tier-1 companies. Staff and principal engineers from Meta, Netflix, Google, and other companies contributed to the course, which focuses on avoiding downleveling, presenting past projects effectively, and giving natural answers.

## Other Aced areas

- [Courses](https://www.aced.io/courses?src=nav), including [Product Management](https://www.aced.io/courses/pm?src=nav), [Forward Deployed](https://www.aced.io/courses/forward-deployed-engineering?src=nav), [Engineering Management](https://www.aced.io/courses/engineering-management?src=nav), [Software Engineering](https://www.aced.io/courses/software-engineering?src=nav), [System Design](https://www.aced.io/courses/system-design-interviews?src=nav), [Data Science](https://www.aced.io/courses/data-science?src=nav), [Machine Learning](https://www.aced.io/courses/ml-engineer?src=nav), and [Data Engineering](https://www.aced.io/courses/data-engineering?src=nav).
- Additional courses: [AI Engineering](https://www.aced.io/courses/ai-engineering?src=nav), [Investment Banking](https://www.aced.io/ib?src=nav), [Generative AI](https://www.aced.io/courses/gen-ai-interviews?src=nav), [Security Engineer](https://www.aced.io/courses/security-engineer?src=nav), [TPM](https://www.aced.io/courses/tpm?src=nav), [Solutions Architect](https://www.aced.io/courses/solution-architect-interview?src=nav), [UX / Product Design](https://www.aced.io/courses/product-designer-interview?src=nav), and [BizOps & Strategy](https://www.aced.io/courses/bizops?src=nav).
- [Loops](https://www.aced.io/guides?src=nav) and [Experiences](https://www.aced.io/experiences?src=nav).
- [All questions](https://www.aced.io/questions?src=nav), [Practice](https://www.aced.io/practice?src=nav), and [Coaching](https://www.aced.io/coaching?src=nav), including [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).
- [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), [Perks](https://www.aced.io/perks?src=nav), and programs for [universities](https://www.aced.io/pages/university?src=nav), [businesses](https://www.aced.io/pages/business?src=nav), [recruiters](https://www.aced.io/jobs/post?src=nav), and [affiliates](https://www.aced.io/affiliate?src=nav).

## Your answer

Use the answer area after signing in. Select **Submit** when finished.

---

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