Monthly Envelope Completion Rate by Account Plan
Last updated: November 29, 2026
Quick Overview
Using tables of envelopes (envelope_id, account_id, sent_at, completed_at, status) and accounts (account_id, plan), write SQL that returns, for each plan and send month, the number of envelopes sent and the share completed within 7 days of sending.
DocuSign
November 29, 20260
0
0 solved
Using tables of envelopes (envelope_id, account_id, sent_at, completed_at, status) and accounts (account_id, plan), write SQL that returns, for each plan and send month, the number of envelopes sent and the share completed within 7 days of sending.
A typical SQL screen for a DocuSign analytics or data science role, where envelope completion is the core health metric for eSignature. The interviewer checks joins, date bucketing, conditional aggregation, and whether you notice that recent cohorts have not had 7 days to complete yet.
What the Interviewer Expects
- Join envelopes to accounts and bucket by the month of sent_at
- Use conditional aggregation for completed within 7 days
- Exclude drafts and voided-before-send envelopes, and state the assumption
- Avoid integer division when computing the rate
- Flag the right-censoring problem for envelopes sent in the last 7 days
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
- How would you change this to report median time to complete?
- Envelopes can have many signers. Would you want a signer-level rate as well, and why?
- How would you exclude test or sandbox accounts?
- The rate dropped 3 points for Enterprise in one month. What would you query next?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice SQL ProblemsSample Answer
Clarify the Data
One row per envelope. sent_at is null for drafts. completed_at is set when the last recipient finishes. status includes sent, delivered, completed, declined, voided. I will count only envelopes ...
Approach
Filter to sent envelopes, join to accounts for plan, group by plan and DATE_TRUNC('month', sent_at). The numerator is a CASE that counts rows completed within 7 days of sending. To avoid penalising ...