FastPrepWebsite Pair with the Most Common Visitors
Problems/Website Pair with the Most Common Visitors

Website Pair with the Most Common Visitors

ZipRecruiter logoZipRecruiter● MediumNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A ZipRecruiter phone-screen report describes visit records, visitors for each website, and picking the website pair with the largest number of shared users. We supplied the row format, how duplicates work, and a fixed tie rule. Our version is about 88% the same as the reported question.

Each row of visits is [user, website]. A user may visit one website more than once, but contributes at most once to that website's visitor set.

Among all unordered pairs of distinct websites, return the pair with the largest number of shared visitors. Sort the two names inside the result. Break ties by the lexicographically smallest pair. Return an empty array when fewer than two distinct websites appear.

Function

mostCommonVisitorPair(visits: String[][]) → String[]

Examples

Example 1

visits = [["u1","a"],["u1","b"],["u2","a"],["u2","b"],["u3","c"]]return = ["a","b"]

Websites a and b share two visitors, more than any other pair.

Example 2

visits = [["u1","a"],["u1","a"],["u1","b"],["u2","b"],["u2","c"]]return = ["a","b"]

Repeated visits by one user do not inflate an intersection.

Constraints

  • 0 <= visits.length <= 50000
  • Every row contains exactly two nonempty strings.

More ZipRecruiter Phone Screen questions

  • Neighboring Record IDsPHONE SCREEN · Seen May 2026
  • Restaurant Vote LeadersPHONE SCREEN · ONSITE INTERVIEW · Seen Feb 2026
  • Most Frequent Word across Grouped ArraysPHONE SCREEN · Seen Sep 2024
  • Starting Value with the Longest Collatz ChainPHONE SCREEN · Seen Apr 2022
  • Classify an Alien Dictionary OrderingPHONE SCREEN · ONSITE INTERVIEW · Seen Mar 2022
  • Multiset Intersection of Three ListsPHONE SCREEN · Seen Feb 2022
  • Find the Smallest Magic IndexPHONE SCREEN · Seen Dec 2021
  • Center-Outward Number SpiralPHONE SCREEN · Seen Jun 2021
  • Missing Ranges within Inclusive BoundsPHONE SCREEN · Seen Feb 2021
  • Fibonacci Number with Constant Extra SpacePHONE SCREEN · Seen Mar 2017

Similar questions at other companies

  • Business Account KYC Verification — Parts 1–5Stripe · PHONE SCREENStripe interview questions
  • Fuzzy Word Lookup With One Misspelled LetterMeta · PHONE SCREENMeta interview questions
  • Most Frequent Call Path From Function Trace LogsRoblox · PHONE SCREEN · ONSITE INTERVIEWRoblox interview questions
  • Group Timestamps into Consecutive-Day IntervalsDuolingo · PHONE SCREENDuolingo interview questions
  • LRU Cache for Query ResultsAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Shortest Pin Path Through TopicsPinterest · PHONE SCREENPinterest interview questions
  • Filter, Sort, and Deduplicate Scheduled TasksRippling · PHONE SCREEN · ONSITE INTERVIEWRippling interview questions
  • In-Memory Filesystem CommandsPerplexity AI · PHONE SCREEN · ONSITE INTERVIEWPerplexity AI interview questions
  • Log Analyzer: Busiest Service in a Rolling WindowByteDance · PHONE SCREENByteDance interview questions
  • LRU CacheServiceNow · PHONE SCREEN · ONSITE INTERVIEWServiceNow interview questions

ZipRecruiter interview experiences

  • ZipRecruiter SWE OA, Level Not Reported: 23 Experiences
  • ZipRecruiter SWE Intern OA Scores: 4 Experiences
  • ZipRecruiter SWE New Grad OA: 9 Experiences
All ZipRecruiter interview questionsSee ZipRecruiter hiring insights
Saved
class Solution {
    public String[] mostCommonVisitorPair(String[][] visits) {
        // Write your code here.
    }

}
Checking account…