Your question is Find Shared Names Pairs. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given two tables (User_age and user_names), find all pairs of userids sharing the same name, returning userid_1, userid_2, and name without duplicates (excluding reverse pairs).
Asked in the SQL and coding round stage. A commenter separately confirmed Meta asks this same question in Solutions Architect interviews.
userid_1, userid_2, and name.name is NULL, and ensure userid_1 is less than userid_2.name, userid_1, and userid_2 ascending.| Column | Type | Description |
|---|---|---|
| useridPK | INTEGER | Unique user identifier |
| age | INTEGER | User age, when available |
| Column | Type | Description |
|---|---|---|
| useridPK | INTEGER | User identifier referencing User_age |
| name | VARCHAR(100) | User display name |