# Disabled Feature Flags

> Disabled flags. Still worth auditing.

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

Domain: SQL · Difficulty: easy · Seniority: L3

## Problem

The platform team is auditing stale feature flags that may be safe to remove. Pull all flags that are currently disabled, showing every column.

## Worked solution and explanation

### Why this problem exists in real interviews

This is a simple WHERE filter query. It screens for the ability to filter on a boolean/integer flag and return all columns.

---

### Break down the requirements

#### Step 1: Filter to disabled flags

`WHERE enabled = false` (or `enabled = 0`) restricts to disabled flags.

#### Step 2: Return all columns

`SELECT *` as specified.

---

### The solution

**Simple boolean filter**

```sql
SELECT *
FROM feat_flags
WHERE enabled = false
```

> **Cost Analysis**
>
> Scan of 600 rows. Trivially fast.

> **Interviewers Watch For**
>
> Whether the candidate uses the correct comparison for the enabled column type (boolean vs integer).

> **Common Pitfall**
>
> Using `enabled IS NULL` instead of `enabled = false` would only match NULLs, not explicitly disabled flags. The two conditions are different.

---

## Common follow-up questions

- What is the difference between enabled = false and NOT enabled? _(In SQL, NOT NULL is NULL, not false. Tests three-valued logic.)_
- How would you also show how long each flag has been disabled? _(Compute CURRENT_DATE - updated for an age metric.)_
- What if you needed to find flags that were recently disabled? _(Add a date filter on the updated column.)_

## Related

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