The customers table receives a daily change feed, so the same customer_id appears many times. Return exactly one row per customer — the one with the newest updated_at. If two rows share a timestamp, keep the higher source_id.
collect() and toPandas() are blockedcustomers| full_name | source_id | updated_at | customer_id | |
|---|---|---|---|---|
| a@x.com | A Sharma | 2 | 2024-03-01T09:00:00Z | 101 |
| a@x.com | A Sharma | 5 | 2024-03-04T11:20:00Z | 101 |
| r@x.com | R Iyer | 1 | 2024-02-27T08:10:00Z | 102 |
| full_name | source_id | updated_at | customer_id | |
|---|---|---|---|---|
| a@x.com | A Sharma | 5 | 2024-03-04T11:20:00Z | 101 |
| r@x.com | R Iyer | 1 | 2024-02-27T08:10:00Z | 102 |
customers| full_name | source_id | updated_at | customer_id | |
|---|---|---|---|---|
| k@x.com | K Rao | 3 | 2024-05-01T00:00:00Z | 7 |
| k2@x.com | K Rao | 9 | 2024-05-01T00:00:00Z | 7 |
| full_name | source_id | updated_at | customer_id | |
|---|---|---|---|---|
| k2@x.com | K Rao | 9 | 2024-05-01T00:00:00Z | 7 |
Community-reported interview topic. Not an official company question and no affiliation is implied.
Run against the public tests, or submit to score against all of them.