Skip to content
Interview Questions

Data Analyst Interview Questions & Answers: Set 9, SaaS & Product Analytics

100 interview questions with model answers for freshers, set in SaaS & Product Analytics: SQL, Excel, statistics, Python, Power BI, business cases, AI and behavioral.

  • Data Analyst
  • SaaS & Product Analytics
  • Set 9 of 20
  • Data
  • SQL
  • Excel
  • Python
  • Power BI
  • AI

Free with login: questions 1 and 2 are open to everyone, all 100 after you log in.

Part of Bundle 2 · Money, Telecom & Tech

What's inside

  • 100 questions, each with a model answer
  • SQL · Excel · Statistics · Python · Power BI · Business Case · AI · Behavioral
  • SQL and Python answers include working code
  • Set 9 of 20 · read free on DS360 with login

Questions and answers

2 of 100 questions shown · Set 9 of 20 · SaaS & Product Analytics

SQL

  1. 1.Calculate monthly recurring revenue (MRR) from a subscriptions table.

    Answer: MRR is the sum of normalised monthly fees from subscriptions active in each month. Assume subscriptions(sub_id, account_id, start_date, end_date, plan_price, billing_period), where end_date is NULL for active subscriptions. Generate the month list, join subscriptions that overlap each month, and convert annual plans to monthly by dividing by 12. Common trap: counting a full annual payment as one month's MRR. Also exclude one-off fees such as setup charges, because MRR is recurring revenue only.

    SQL
    WITH months AS (
      SELECT generate_series(DATE '2026-01-01', DATE '2026-09-01',
                             INTERVAL '1 month')::date AS month
    )
    SELECT
      m.month,
      SUM(CASE WHEN s.billing_period = 'annual'
               THEN s.plan_price / 12.0
               ELSE s.plan_price END) AS mrr
    FROM months m
    JOIN subscriptions s
      ON s.start_date < m.month + INTERVAL '1 month'
     AND (s.end_date IS NULL OR s.end_date >= m.month)
    GROUP BY m.month
    ORDER BY m.month;
  2. 2.Find users who upgraded from the free to the paid plan and how many days it took.

    Answer: Find each user's first free plan start and first paid plan start, keep users where paid came after free, and subtract the dates. Assume plan_changes(user_id, plan_type, changed_at) with plan_type 'free' or 'paid'. Conditional MIN inside one GROUP BY avoids a self-join. In PostgreSQL, subtracting two dates gives whole days; on timestamps cast to date first. Users who paid straight away without a free period are excluded by the HAVING clause.

    SQL
    SELECT
      user_id,
      MIN(changed_at) FILTER (WHERE plan_type = 'free') AS free_start,
      MIN(changed_at) FILTER (WHERE plan_type = 'paid') AS paid_start,
      MIN(changed_at::date) FILTER (WHERE plan_type = 'paid')
        - MIN(changed_at::date) FILTER (WHERE plan_type = 'free')
        AS days_to_upgrade
    FROM plan_changes
    GROUP BY user_id
    HAVING MIN(changed_at) FILTER (WHERE plan_type = 'paid')
         > MIN(changed_at) FILTER (WHERE plan_type = 'free')
    ORDER BY days_to_upgrade;

Loading all 100 questions…

Related resources

See all resources →