Group Creators Whose Follower Sets Are Exactly Identical

Last updated: November 29, 2026

Quick Overview

Given a map from creator ID to a list of follower IDs (which may contain repeats and arrive in any order), return groups of creators who share exactly the same set of followers. Only return groups with at least two creators.

TikTok
Coding & Algorithms
Software Engineer
TikTok
November 29, 2026
Software Engineer
Online Assessment
Coding & Algorithms
Easy

0

0

0 solved


Given a map from creator ID to a list of follower IDs (which may contain repeats and arrive in any order), return groups of creators who share exactly the same set of followers. Only return groups with at least two creators.

This kind of warm-up appears in TikTok online assessments for backend roles, framed around detecting coordinated or bot-farm accounts that are followed by the same audience. The interviewer checks whether you can pick a canonical, hashable key for a set and avoid quadratic pairwise comparison.

What the Interviewer Expects
  • Normalizes each follower list into an order-independent, duplicate-free key
  • Uses a hash map from canonical key to creators instead of comparing every pair
  • Filters out singleton groups as the problem asks
  • States time complexity in terms of total follower entries
  • Mentions that empty follower lists form their own valid group
Key Topics to Cover
hash maps
canonical keys
frozenset
grouping
deduplication
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • What if follower lists have millions of entries and you cannot hold full sets as keys?
  • How would you find creators whose follower sets overlap by at least 90 percent instead of exactly?
  • How would you run this over billions of creators in a batch job?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements
  • Input: dict[str, list[int]], creator to followers, lists may repeat IDs and be unordered.
  • Output: list of groups (lists of creator IDs), each of size 2 or more, where every member has the identi...
High-Level Design

Exact set equality means I need a key that is the same for equal sets regardless of order or duplicates. Two good choices:

  1. frozenset(followers): hashable, ignores order and duplicates.
  2. `tuple...

Submit Your Answer
Markdown supported