The Article Views I interview question is a common SQL/Database task. You are given a table Views containing columns: article_id, author_id, viewer_id, and view_date. The task is to find all the authors that viewed at least one of their own articles. The result should be sorted by author ID in ascending order. This Article Views I coding problem is a test of basic filtering and deduplication in a database.
Companies like Apple, Deloitte, and Google use this in their initial screening for Data Engineer or Backend roles. It checks if you understand how to compare columns within the same row, how to remove duplicate results using DISTINCT, and how to apply sorting using ORDER BY.
This follows the standard Database interview pattern of "Select-Filter-Sort." You use a SELECT DISTINCT clause to get the unique IDs, a WHERE clause to filter rows where the author is the viewer, and an ORDER BY clause for the final presentation.
Suppose the Views table has these rows:
Always pay attention to the sorting requirements and the need for unique results in SQL problems. Practice comparing two columns of the same table, as this is the simplest form of a "self-join" logic without actually needing a JOIN.