# Calculate Test Scores — SQL 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/3047/calculate-test-scores
Source observed: 2026-11-04T21:34:34.017Z
Last checked: 2026-11-04T21:34:34.017+00:00
Indexed: 2026-11-05T06:20:31.004+00:00

---

# Calculate Test Scores

**Difficulty:** Medium  
**Category:** Coding · SQL  
**Interview coverage:** 5 interviews  
**Reported last asked:** a year ago  
**Company associated with this question:** [Google](https://www.aced.io/questions?company=google)  
**Relevant roles:** [Data Scientist](https://www.aced.io/questions?role=data-science), [Data Engineer](https://www.aced.io/questions?role=data-engineer), [Data Analyst](https://www.aced.io/questions?role=data-analyst)

We provide this SQL practice question through Aced, formerly Exponent. The task concerns calculating each backend developer’s overall score across SQL tests when a developer may attempt the same test multiple times.

## Problem

An organization has conducted SQL tests for all its backend developers. A developer could attempt a test multiple times. The organization wants to calculate the overall scores of the candidate for the SQL tests.

Write a query to print `employee_id`, `employee_name`, and `total_score` obtained by the developers. A developer's `total_score` is the sum of their maximum scores for all tests. If the developer has attempted a single test multiple times, consider the maximum score of all the attempts for that test.

Order the results in descending `total_score`. If more than one developer has obtained the same `total_score`, sort the results by ascending `employee_id`.

## Schema

```text
tests
+------+---------+
| id   | int     | <----------+
| name | varchar |            |
+------+---------+            |
                               |
employees                     |
+------+---------+            |
| id   | int     | <-------+  |
| name | varchar |         |  |
+------+---------+         |  |
                            |  |
                            |  |
test_results                  |
+-------------+---------+  |  |
| id          | int     |  |  |
| employee_id | int     | -+  |
| test_id     | int     | ----+
| score       | decimal |     |
+-------------+---------+     |
```

The interactive workspace includes a SQL dialect selector, an editor, output and test-results tabs, and a console. Running code requires [sign-up](https://www.aced.io/signup?src=lesson).

## Access and community

The solution tab is locked behind [Upgrade](https://www.aced.io/upgrade?src=questions). The community tab shows 32 entries, and no community answers have been contributed yet.

## Interview experience

One shared experience is associated with this question: [Google · Data Scientist interview experience](https://www.aced.io/experiences/google-data-scientist-interview-15dc1f). The contributor described starting with recruiter screening and light technical questions, followed by several rounds with very light coding, mostly case studies and statistics knowledge, and a strong theory/application focus. The experience is attributed to the contributor and concerns Google.

## Related question

- [Calculate the cost of cash?](https://www.aced.io/questions/7018/calculate-cost-of-cash)

## Related courses

![Data Analyst Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/72OTqij57b2TklhaD2vrdV/be0dae6242904970d1696e5a4d858e18/AdobeStock_1357126576.jpeg?w=800&h=800&fm=webp&q=75)

### [Data Analyst Interview Prep](https://www.aced.io/courses/data-analytics)

We help candidates prepare for data analyst interviews across product, marketing, and business analyst roles with real take-home case studies, technical and dashboarding practice, and strategies from interviewers at top technology companies and startups.

![Data Science Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/3U4C5C0OkDR0UeGch4AmlE/7ad489430b676a088cb973307fe77884/Data_Science_Interview_Prep_Course.jpeg?w=800&h=800&fm=webp&q=75)

### [Data Science Interview Prep](https://www.aced.io/courses/data-science)

We help candidates prepare for data science roles at Google, Amazon, Microsoft, Meta, Apple, and other companies through mock interviews, frameworks, and advice from senior candidates. Practice areas include statistics, experimentation, coding, SQL, machine learning, behavioral interviews, and more.

[Browse all questions](https://www.aced.io/questions) · [Aced home](https://www.aced.io/?src=nav)

---

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