Calculate engagement score per date
Last updated: July 15, 2025
Quick Overview
Write a query to compute engagement score grouped by region, handling edge cases like nulls and duplicates.
Goldman Sachs
July 15, 202517
7
4,469 solved
Write a query to compute engagement score grouped by region, handling edge cases like nulls and duplicates.
Data manipulation questions at Goldman Sachs test your ability to work with real-world datasets. This Technical Screen question evaluates your SQL proficiency, understanding of data modeling, and ability to derive insights from raw data.
What the Interviewer Expects
- Write syntactically correct SQL with proper JOIN and WHERE clauses
- Use GROUP BY and aggregate functions appropriately
- Handle NULL values correctly in your queries
- Explain the query execution plan at a high level
Key Topics to Cover
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
- What indexes would you create to support this query?
- How would you handle this if the data was spread across multiple databases?
- What would you do if this query needs to run every 5 minutes?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice SQL ProblemsSample Answer
Problem Understanding
The task is to compute an engagement score grouped by region for a given date. The engagement score might be derived from various activities recorded in a hypothetical table, such as user interactions...
Approach
- Identify the Source Table: Determine the table that contains the engagement data. For this example, let's assume it is named
engagement_data. - Select Relevant Columns: Focus on the `dat...