Select Products Marked Both Low Fat and Recyclable
Company: Google
Role: Software Engineer
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
### Problem
Return product_id for products whose low_fats and recyclable values are both Y. Each flag is the source Y/N category. Rows may be returned in any order.
### Tables
Table: `Products`
```text
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| product_id | int |
| low_fats | enum |
| recyclable | enum |
+-------------+---------+
product_id is the primary key (column with unique values) for this table.
low_fats is an ENUM (category) of type ('Y', 'N') where 'Y' means this product is low fat and 'N' means it is not.
recyclable is an ENUM (category) of types ('Y', 'N') where 'Y' means this product is recyclable and 'N' means it is not.
```
### Example
```text
Products (product_id,low_fats,recyclable): (1,Y,N), (2,N,Y), (3,Y,Y), (4,N,N)
Output (product_id): (3)
```
### What a Strong Answer Covers
- Require both flags to be Y and return only product IDs.
- Handle cases where no product meets both flags.
### Follow-up Questions
- How would you report counts for all four flag combinations?
- How would the result change if unknown flag values were allowed?
Overview: Return product_id for products whose low_fats and recyclable values are both Y. Each flag is the source Y/N category. Rows may be returned in any order.