Day 70 — Review + Phase 3 Assessment
Coding problem
| Problem | Review + Phase 3 Assessment |
| LeetCode ID(s) | — |
| Difficulty | Mixed |
| Pattern | Review |
| Company tags | — |
| Suggested time | 30m |
Solution outline (coding)
- Simulate a full round: hard medium + design from weeks 7–9.
- Strict timing: 25 min code + 10 min dry-run tests.
- Debrief: where you lost time (reading, debugging, complexity).
Time complexity: Varies — mock interview.
Space complexity: Varies.
Show Python solution
class ReviewDay:
"""Practice / review: Review + Phase 3 Assessment."""
def practice_plan(self):
return [
"Pick 2–3 problems from this phase; re-solve timed without notes.",
"For each: pattern name, time/space complexity, one alternative approach.",
]
# Input: (your choice of problems from this week or phase)
# Output: a short list of gaps to drill before the next sessionSQL interview practice
1. Interview question
Companies / track: Review / mixed (see weekly theme)
This is a review / mixed day. Expect SQL that blends data quality, funnels, and metric definitions—the same mix you see across consumer tech and ads analytics.
What you are asked to write (SQL prompt):
Review / mixed week — use the same tables and deliverables as in a standard onsite SQL round.
For all hard-style metrics tables above, create a BigQuery job that snapshots KPIs daily and supports A/B tests on algorithm variants via side-by-side metrics.
Tables implied by the prompt:
- Infer schemas from the prompt and state them before coding.
Engine: BigQuery — use its date, array, and approximate functions as documented.
2. Solution outline
- Clarify out loud: result grain (one row per what?), join keys, time zone, and any
ORDER BY/LIMIT/ tie-breakers. - Map Review to SQL: say the relational equivalent (e.g. hash map →
GROUP BY+ key; two pointers → ordered window + filter). - Filter time first: predicate on
DATE(ts)/ partition column before heavy joins; state the window in plain English. - Structure: CTEs (
WITH) — one step per CTE; validate on a tiny slice (counts, nulls, duplicates).
Show SQL solution (BigQuery)
Main query
SELECT run_date, variant, AVG(metric) AS kpi FROM ab_algo_runs GROUP BY run_date, variant;