← DocuSign Interview Insights

DocuSign·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Went through a technical phone screen for a software engineer role at DocuSign. One coding problem, graph/union-find territory. Nothing too wild but it took me longer than I'd like to admit to land on the right approach.

Questions Asked (1)

Q1

You're given a list of accounts, each with a username and a set of email addresses. Merge any accounts that share at least one email, since they belong to the same person. Return the merged results with emails sorted and the username attached.

Algorithms & Data Structures
Author's notes

I knew union-find was the right tool pretty quickly but fumbled the bookkeeping.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the problem as a graph where emails are nodes and accounts are edges, then find connected components using Union-Find or DFS. For each component, collect all emails, sort them, and attach the first username encountered.

Pro tip: Mention that Union-Find with path compression and union by rank gives near O(N α(N)) time, which is optimal for this problem. Also, clarify that the username choice is arbitrary but typically the first account's username in the component is used.

1. Clarify requirements and edge cases

Confirm that accounts sharing any email should be merged, and that the output should have emails sorted and a username (e.g., the first account's username). Ask about input size and whether emails are unique per account.

2. Choose data structures

Use a hash map to map each email to an account index or a Union-Find parent array. For Union-Find, initialize parent for each account and union accounts that share an email.

3. Build connections

Iterate through each account and its emails. For each email, if it's seen before, union the current account with the account that first had that email; otherwise, record the email's owner.

4. Group and format results

After processing, group emails by their root parent. For each group, sort the emails and pick a username (e.g., the first account's username in that group).

5. Analyze complexity and test

State time complexity O(N α(N) + M log M) where N is number of accounts and M total emails, and space O(N + M). Walk through a small example to verify correctness.

Key Points to Mention

  • Union-Find (Disjoint Set Union) with path compression and union by rank for efficient merging.
  • Hash map to track the first occurrence of each email and link accounts.
  • Sorting emails within each merged account as required.
  • Handling of duplicate emails within the same account (ignore or deduplicate).
  • Time and space complexity analysis.
  • Potential alternative: DFS/BFS on a graph where emails are nodes and accounts are edges.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.