# Platform Team Feature Flags

> The platform team owns a lot of flags.

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

Domain: SQL · Difficulty: easy · Seniority: L3

## Problem

The platform team is auditing their feature flag inventory before a major release. Pull all fields for every flag they own.

## Worked solution and explanation

### Why this problem exists in real interviews

Interviewers use this inventory management scenario to test filtering and projection against the `feat_flags` table. The focus is on how you handle the `owner` column when building the result.

---

### Break down the requirements

#### Step 1: Filter to platform team

`WHERE owner = 'platform'` restricts to flags owned by the platform team.

#### Step 2: Return all fields

`SELECT *` returns every column for matching flags.

---

### The solution

**Filter to platform team to find platform team feature flags**

```sql
SELECT *
FROM feat_flags
WHERE owner = 'platform'
```

> **Cost Analysis**
>
> With `feat_flags` (500 rows), this query scans a small dataset. No indexing is needed for this volume. At production scale, an index on the primary filter column would improve performance.

> **Interviewers Watch For**
>
> Interviewers evaluate whether you translate the English requirements into the correct SQL clauses on the first attempt. They watch for clean syntax, correct column references, and whether you verify edge cases before declaring the query complete.

> **Common Pitfall**
>
> The most common mistake is misreading the prompt's filtering or grouping requirements. Double-check which columns to group by, which to aggregate, and whether the output should be filtered with `WHERE` (before grouping) or `HAVING` (after grouping).

---

## Common follow-up questions

- What would happen to your result if `feat_flags.flag_id` contained duplicate values that you did not expect? _(Tests whether the candidate considers data quality issues in `flag_id` and uses DISTINCT or deduplication where needed.)_
- The `owner` column in `feat_flags` is heavily skewed toward a few popular values. How would data skew affect parallel execution of your query? _(Tests understanding of skew in `feat_flags.owner` and its impact on distributed query performance.)_
- `feat_flags.enabled` only has 2 distinct values. If a new category were added, would your query automatically include it? _(Tests whether the query hard-codes values or dynamically adapts to `enabled` changes.)_

## Related

- [All practice problems](https://datadriven.io/problems)
- [Mock interview mode](https://datadriven.io/interview/platform_team_feature_flags)
- [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.