# Most Common Words — 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/3622/most-common-words
Source observed: 2026-11-04T22:21:39.246Z
Last checked: 2026-11-04T22:21:39.246+00:00
Indexed: 2026-11-05T20:01:03.939+00:00

---

# Most Common Words

We provide this **Easy** data-structures-and-algorithms coding question for interview preparation. It concerns implementing a Python function that counts words in a long text string.

## Problem

Write a function `most_common_words(text)` that returns an array containing words with their frequencies. Sort the results from most common to least common; break ties by alphabetic order. For greater accuracy, ignore punctuation and capitalization.

```python
def most_common_words(text):
    # Your code here
```

## Example

Given:

```python
text = 'It was the best of times, it was the worst of times.'
```

`most_common_words(text)` should return a frequency-sorted result. The supplied example does not include the expected returned array.

## Practice interface

The question includes Python as the selected language and an editor with **Output**, **Test Results**, and **Console** panels. The solution tab is locked, and the community tab is marked with 38 contributions. Available practice controls include **Hint 1**, **Hint 2**, **Hint 3**, and **Challenge 1**. Running code requires signing up: [Sign up to run code](https://www.aced.io/signup?src=lesson).

## Question details

- Difficulty: Easy
- Reported interview count: 4
- Category: Data Structures & Algorithms
- Additional category: Coding
- Reported last asked: 7 months ago
- Related role filters: [Machine Learning Engineer](https://www.aced.io/questions?role=ml-engineer), [Software Engineer](https://www.aced.io/questions?role=swe), and [Security Engineer](https://www.aced.io/questions?role=security-engineer)
- Related company filters: [Amazon](https://www.aced.io/questions?company=amazon) and [Microsoft](https://www.aced.io/questions?company=microsoft)
- [All Questions](https://www.aced.io/questions)
- Detailed company statistics require an [Upgrade](https://www.aced.io/upgrade?src=questions).

## Interview experiences

Two shared interview experiences are associated with this question:

1. **Microsoft — 7 months ago** ([read the experience](https://www.aced.io/experiences/microsoft-machine-learning-engineer-interview-f29ce8))

   Role: Machine Learning Engineer · Entry Level / L3

   > “What went well: The live coding and system architecture rounds went smoothly. I was able to articulate my design choices clearly, especially around API design, database strategy, and maintaining high availability for microservices. What didn’t go well: The initial behavioral portion felt slightly rushed because we spent extra time discussing specific cross-functional project dynamics from my previous roles. How does this interview compare to other interviews you've done? It was significantly more interactive. Rather than giving static answers, the interviewers actively challenged my assumptions and asked \"what if\" scenarios, making the evaluation feel comprehensive and realistic to day-to-day work.”

   [Microsoft logo](https://exponent-static.s3.amazonaws.com/company_logos/microsoft.png)

2. **Amazon — 9 months ago** ([read the experience](https://www.aced.io/experiences/amazon-software-engineer-intern-interview-0fc99d))

   Role: Software Engineer · Intern

   > “Process was straightforward with quick feedback. Got a 3d dp and then easy second interview which was standard hashmap manipulation.”

   [Amazon logo](https://exponent-static.s3.amazonaws.com/company_logos/amazon.png)

## 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 help candidates prepare for machine-learning roles at Meta, Google, Amazon, Apple, Microsoft, Nvidia, and other top companies through mock interviews, frameworks, and advice from senior candidates. Topics include ML system design, core concepts, coding, and behavioral interviews.

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

We help candidates prepare for software-engineering roles at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Practice covers data structures, algorithms, system design, people management, and behavioral interviews, with mock interviews, frameworks, and advice from senior candidates.

## Company identity

We are **Aced**, formerly known as **Exponent**. We provide technical interview preparation through coding questions, interview experiences, courses, practice tools, and coaching resources.

---

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