Day 90 — FINAL REVIEW

Coding problem

ProblemFINAL REVIEW
LeetCode ID(s)
DifficultyMixed
PatternReview
Company tagsAll Companies
Suggested time30m

Solution outline (coding)

  • Skim all 90 titles; star ≤5 for last practice before interviews.
  • Do one easy warm-up + one medium under time; verbalize complexity each time.
  • Rest and logistics: environment, IDE, and communication habits.

Time complexity: Varies — consolidation.

Space complexity: Varies.

Show Python solution
class ReviewDay:
  """Practice / review: FINAL REVIEW."""

  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 session

SQL interview practice

1. Interview question

Companies / track: All companies (general analytics)

Universal analytics: geography rollups, time windows, and joins to user dimensions show up in almost every big-tech SQL round—think payments, ads, or subscriptions.

What you are asked to write (SQL prompt):

Phone-screen style (any large tech company) — revenue, geo, and time windows are universal.
Final review: a BigQuery query pack that (1) lists all critical tables with freshness, row counts, anomaly scores; (2) lists last 30 days’ failed jobs; (3) surfaces slowest 10 queries by bytes processed.

Tables implied by the prompt:

  • that(1)

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.
  • Cost: selective columns, partition pruning, avoid SELECT * when tables are huge.
  • Structure: CTEs (WITH) — one step per CTE; validate on a tiny slice (counts, nulls, duplicates).
Show SQL solution (BigQuery)

Main query

SELECT 'freshness' AS report, table_name, last_modified_ts FROM table_freshness
UNION ALL
SELECT 'failed_jobs', job_id, run_ts FROM failed_jobs WHERE run_ts >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
UNION ALL
SELECT 'slow_queries', query_id, total_bytes_processed FROM query_stats ORDER BY total_bytes_processed DESC LIMIT 10;