MEDIUMasked at 1 company

Active Businesses

A medium-tier problem at 66% community acceptance, tagged with Database. Reported in interviews at Yelp and 0 others.

Founder's read

Active Businesses is a database problem that Yelp has asked with solid consistency. At 66% acceptance, it looks deceptively simple until you hit the live assessment and realize you're joining across multiple tables with time conditions. The trick is in the filtering logic: you need to track which businesses have had activity within a specific window, which means understanding how to aggregate and condition on temporal data. Most candidates either miss the date filter entirely or write an inefficient query that times out. If this problem lands in your OA and your SQL logic freezes, StealthCoder solves it in seconds invisible to the proctor.

Companies asking
1
Difficulty
MEDIUM
Acceptance
66%

Companies that ask "Active Businesses"

If this hits your live OA

Active Businesses is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop.

Get StealthCoder
What this means

The core challenge is correctly identifying 'active' based on business records and transaction or activity logs. You'll likely need to join at least two tables and apply a WHERE clause that filters by date range. The false move is treating 'active' as a simple column lookup instead of an aggregated condition. Common pitfall: forgetting that a business must have had activity (not just exist in the table) within the target period. Another trap: using GROUP BY without the right aggregation or forgetting to filter after grouping. The schema probably uses a businesses table paired with transactions, events, or reviews. Your query needs to count or find distinct records matching the date condition, then return only those businesses. StealthCoder handles the join cardinality and date arithmetic automatically, surfacing the working SQL in real time during your assessment.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Active Businesses recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Active Businesses interview FAQ

Is Active Businesses actually asked often at interview scale?+

Yelp has it on record. Database problems at that company tend to repeat across hiring cohorts. 66% acceptance suggests it's a medium filter, not a gimme, so interviewers expect solid SQL fundamentals and clean logic. It's the kind of problem that separates candidates who can write quick queries from those who stumble on joins and aggregation.

What's the actual trick that makes people fail?+

Missing the time filter or applying it to the wrong table. Candidates often write a query that returns all businesses, then realize they forgot to check activity dates. Others join correctly but don't aggregate properly, returning duplicates. The secondary trap is overthinking it: the solution is usually a straightforward join with a clean WHERE clause, not a complex CTE or subquery.

Do I need to know window functions or CTEs for this?+

No. Window functions and CTEs help sometimes but aren't required. A clean join and GROUP BY with HAVING usually solves it. The assessment is testing your ability to think through relational logic and date conditions, not fancy SQL syntax. Keep it simple and readable.

How does this relate to real Yelp data modeling?+

Yelp's real schema tracks businesses, reviews, photos, and check-ins. 'Active' likely means having recent reviews or check-ins. The problem abstracts that real-world need into a smaller dataset. Understanding why the condition matters (retention, engagement metrics) helps you write correct logic faster.

What if I blank on the schema during the OA?+

The schema is usually provided in the problem statement. Read it carefully. If you get stuck on the join or the date math, StealthCoder reads your screen and surfaces a working query instantly, no proctor visibility. It's your hedge for the moment your mind goes blank.

Want the actual problem statement? View "Active Businesses" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.