Interview Questions/SQL/Invalid Tweets

Invalid Tweets

Preview mode. Log in to edit, run, submit, and save progress.

Medium

Invalid Tweets

You have a Tweets table. A tweet is considered invalid if its content length is strictly greater than 15 characters. Write a SQL query to find the IDs of all invalid tweets. Return the result in any order.

Examples

Example 1

Tweet 1 has length 14 (valid). Tweet 2 has length 32 (invalid, > 15).

Approach hint

Start with a simple approach, explain the trade-off, then move toward a cleaner or more scalable solution.

Common mistake

Skipping assumptions, edge cases, or trade-offs can make an otherwise good answer feel incomplete.

query.sql