# Number Finder — 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/3627/number-finder
Source observed: 2026-11-05T00:29:28.046Z
Last checked: 2026-11-05T00:29:28.046+00:00
Indexed: 2026-11-06T05:25:59.551+00:00

---

# Number Finder

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

We present a coding interview problem about finding the first occurrence of a number in an array. The scenario uses daily web-server logs: the server returns status code `200` for a while, then begins returning `500` responses. The goal is to efficiently find the first `500`, which identifies the suspected breaking point.

## Problem

Write a function `find_first(array, num)` that returns the index at which `num` first appears in the input array.

- **Input:** an array of numbers and a number to find
- **Output:** the index where `num` first appears, or `-1` if it does not appear

## Example

```python
input = [200, 200, 200, 200, 500, 500, 500]
find_first(input, 200)  # => 0
find_first(input, 500)  # => 4
find_first(input, 100)  # => -1
```

The page includes Question, Solution, and Community tabs, along with hints and challenges. No community answers have been contributed yet. Running code requires [signing up](https://www.aced.io/signup?src=lesson). Detailed company statistics are available through [Upgrade](https://www.aced.io/upgrade?src=questions).

## Related questions

- [Find Largest Numbers](https://www.aced.io/questions/3623/find-largest-numbers)
- [Fibonacci Numbers](https://www.aced.io/questions/3631/fibonacci)

You can return to [All Questions](https://www.aced.io/questions).

---

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