# Find Customer Lifetime Value (LTV)

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/3975/find-customer-lifetime-value
Source observed: 2026-11-04T23:34:34.896Z
Last checked: 2026-11-04T23:34:34.896+00:00
Indexed: 2026-11-06T15:56:38.886+00:00

---

# Find Customer Lifetime Value (LTV)

We provide this **Medium** SQL coding interview question for **Data Engineer**, **Data Scientist**, and **Data Analyst** roles. It is categorized under **Coding** and **SQL**. The question has been reported as last asked a year ago and is marked as appearing in 4 interviews. A solution is available through our upgrade flow: [Upgrade](https://www.aced.io/upgrade?src=questions).

## Problem

You are given the following tables.

### `attribution`

| session_id | marketing_channel | purchase_value |
| --- | --- | --- |
| string | string | float |

### `user_sessions`

| session_id | ad_click_timestamp | user_id |
| --- | --- | --- |
| string | datetime | string |

Find the customer lifetime value (LTV) for each user and order the results from the most valuable customer to the least valuable. Your output must contain these columns:

- `user_id`
- `LTV`

The page includes a **Hint 1** control and separate **Question**, **Solution**, and **Community** tabs. No community answers have been contributed yet. The interactive editor includes **Output**, **Test Results**, and **Console** panels, but running code requires [signing up](https://www.aced.io/signup?src=lesson).

## Related questions

- [Design an MVP for Booking's homepage to improve customer lifetime value.](https://www.aced.io/questions/2206/design-mvp-booking-homepage-clv)
- [Find Top Customer by Year](https://www.aced.io/questions/3977/find-top-customer-by-year)
- [Design a lifetime value (LTV) prediction system.](https://www.aced.io/questions/7269/design-ltv-prediction-system)

## Related courses

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

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

Ace your data analyst interviews—whether you're targeting product, marketing, or business analyst roles. Tackle real take-home case studies, sharpen your technical and dashboarding skills, and get strategies from interviewers at top tech companies and startups.

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

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

Land your dream data science role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates. Practice statistics, experimentation, coding, SQL, machine learning, behavioral interviews, and more.

## Explore Aced

We are Aced, formerly Exponent. We offer interview preparation courses, interview questions, practice, experiences, coaching, resume review, salary negotiation, job referrals, and related resources.

- [All Questions](https://www.aced.io/questions)
- [Courses](https://www.aced.io/courses?src=nav)
- [Loops](https://www.aced.io/guides?src=nav)
- [Experiences](https://www.aced.io/experiences?src=nav)
- [Practice](https://www.aced.io/practice?src=nav)
- [Coaching](https://www.aced.io/coaching?src=nav)
- [Pricing](https://www.aced.io/upgrade?src=nav)
- [Log in](https://www.aced.io/login?src=nav)
- [Sign up](https://www.aced.io/signup?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%2F3975%2Ffind-customer-lifetime-value&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%2F3975%2Ffind-customer-lifetime-value). Opening a form does not execute a tool.