# The February Cohort

> One signup window. One cohort. Who joined the club?

Canonical URL: <https://datadriven.io/problems/the_february_cohort>

Domain: SQL · Difficulty: easy · Seniority: L3

## Problem

The retention team is running a re-engagement campaign targeting the February 2024 signup cohort. Pull the full profile for every user who signed up that month.

## Worked solution and explanation

### Why this problem exists in real interviews

This tests basic date filtering and aggregation. The interviewer wants to see if you can extract a month from a date column, filter accurately, and compute a count or summary for that cohort.

---

### Break down the requirements

#### Step 1: Filter to February signups

Use a range predicate `WHERE signup_date >= '2026-02-01' AND signup_date < '2026-03-01'` to isolate February users. A range predicate is preferred for index utilization over `strftime`.

#### Step 2: Return the cohort

Select the relevant user columns for the February cohort. The prompt asks for identification, so return the filtered rows directly.

---

### The solution

**Date range filter for monthly cohort extraction**

```sql
SELECT *
FROM users
WHERE signup_date >= '2026-02-01'
  AND signup_date < '2026-03-01'
ORDER BY signup_date
```

> **Cost Analysis**
>
> A range predicate on `signup_date` is sargable and can use a B-tree index directly. Using `strftime` or `MONTH()` prevents index usage and forces a full table scan.

> **Interviewers Watch For**
>
> Interviewers check whether you default to sargable predicates for date filtering. Even on an easy question, writing `MONTH(signup_date) = 2` instead of a range predicate signals a gap in query optimization fundamentals.

> **Common Pitfall**
>
> Using `strftime('%m', signup_date) = '02'` works functionally but is not sargable. It forces evaluation of the function on every row. Always prefer range predicates for date-based filters.

---

## Common follow-up questions

- What if February cohort spans multiple years? _(Tests adding year to the filter or grouping by year-month.)_
- How would you count the February cohort alongside all other monthly cohorts? _(Tests GROUP BY with date truncation across all months.)_
- What if signup_date includes a time component? _(Tests boundary handling: '2026-03-01' as exclusive upper bound still works with timestamps.)_

## Related

- [All practice problems](https://datadriven.io/problems)
- [Mock interview mode](https://datadriven.io/interview/the_february_cohort)
- [SQL Interview Questions](https://datadriven.io/sql-interview-questions)
- [Data Engineering Interview Prep Guide](https://datadriven.io/data-engineer-interview-prep)
- [Daily Challenge](https://datadriven.io/daily)

---

Source: DataDriven (https://datadriven.io). 100% free data engineering interview prep. Live code execution against Postgres 16, Python 3.11, and Spark sandboxes. No paywall, no premium tier, no signup gate.