# Find Largest Numbers — coding interview question

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/3623/find-largest-numbers
Source observed: 2026-11-04T23:36:18.640Z
Last checked: 2026-11-04T23:36:18.64+00:00
Indexed: 2026-11-07T03:01:55.762+00:00

---

# Find Largest Numbers

**Difficulty:** Medium  
**Category:** [Data Structures & Algorithms](https://www.aced.io/questions?type=algorithms) and [Coding](https://www.aced.io/questions?type=coding)

We provide this coding interview question for candidates preparing for software engineering, backend engineering, and machine learning engineering interviews. It asks you to process a potentially very large unsorted collection and return its largest values.

## Problem

Given a long list of unsorted numbers—potentially millions of values—implement `find_largest(input, m)` to find and return the largest `m` values from an input array or file.

If the input array is empty, return `None` in Python or `null`.

## Examples

### Python array

```python
find_largest([1, 5, 4, 2, 3], 3)  # => [3, 4, 5]
```

### Python local file

This sample creates a file containing line-separated numbers and then reads it:

```python
# Create a new file with line-separated numbers
with open('numbers.txt', 'w') as file:
    for n in range(0, 1000):
        print(str(n), file=file)

# Find the largest numbers in the file
with open('numbers.txt') as file:
    find_largest(file, 2)  # => [998, 999]
```

## Interview metadata

The question is listed as having been last asked **6 months ago** and is associated with **5 interviews**. Its listed roles are [Software Engineer](https://www.aced.io/questions?role=swe), [Backend Engineer](https://www.aced.io/questions?role=backend-engineer), and [Machine Learning Engineer](https://www.aced.io/questions?role=ml-engineer). Associated companies are [Accenture](https://www.aced.io/questions?company=accenture), [TikTok](https://www.aced.io/questions?company=tiktok), and [Goldman Sachs](https://www.aced.io/questions?company=goldman-sachs).

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

## Practice interface

We provide Question and Solution tabs, expandable Hint 1, Hint 2, Hint 3, and Challenge 1 sections, an editor with Editor and Share views, and Output, Test Results, and Console panels. You can [sign up to run code](https://www.aced.io/signup?src=lesson).

## Interview experience

One interview experience is shared for [Accenture](https://www.aced.io/experiences/accenture-software-engineer-interview-21d9a5), from **6 months ago**, for a **Software Engineer · Mid Level / L4** role:

> The interview focused on my experience with Node.js backend development, including API design, database management, caching, and real-world project implementations. What went well was explaining my production experience and problem-solving approach; areas for improvement include providing more detailed answers on certain concepts and system design scenarios.

## Related questions

- [Number Finder](https://www.aced.io/questions/3627/number-finder)
- [Find the largest number possible from a given set of numbers.](https://www.aced.io/questions/1123/largest-number-from-set-of-numbers)
- [Fibonacci Numbers](https://www.aced.io/questions/3631/fibonacci)

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

Our machine learning interview preparation covers mock interviews, frameworks, senior-candidate advice, ML system design, core concepts, coding, and behavioral interviews. It is intended for roles at Meta, Google, Amazon, Apple, Microsoft, Nvidia, and other companies.

### [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 software engineering interview preparation covers data structures, algorithms, system design, people management, and behavioral interviews through mock interviews, frameworks, and advice from senior candidates. It is intended for roles at Google, Amazon, Microsoft, Meta, Apple, and other companies.

---

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