FastPrepBrowser History by Frequency and Recency
Problems/Browser History by Frequency and Recency

Browser History by Frequency and Recency

Bloomberg LP logoBloomberg LP● MediumNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported with two examples in a first-hand Bloomberg graduate interview. The practice rule pins the newest URL, matching the source's explicit priority and examples.

Given visits, a list of URLs from oldest to newest, return each distinct URL once, in ranked order.

The most recently visited URL always comes first. Sort the rest by visit count, highest first. Break ties by most recent visit, newer first, and then in lexicographic order (the smaller string first).

Function

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

Examples

Example 1

visits = ["BBC","BBC","Google","facebook"]return = ["facebook","BBC","Google"]

facebook is the newest visit, so it comes first. BBC was visited twice and Google once, so BBC comes before Google.

Constraints

  • 0 <= visits.length <= 10^5.

More Bloomberg LP Phone Screen questions

  • N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Fewest Coins CombinationPHONE SCREEN · Seen Nov 2026
  • Recommend Films from Viewers Who Watched Everything You DidPHONE SCREEN · Seen Nov 2026
  • Track New Values in Sorted OrderPHONE SCREEN · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Sparse Vector and Matrix OperationsPHONE SCREEN · Seen Oct 2026
  • Add Two Numbers IIPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026

Similar questions at other companies

  • In-Memory Filesystem CommandsPerplexity AI · PHONE SCREEN · ONSITE INTERVIEWPerplexity AI interview questions
  • Worst-Performing Ads by CTR in a Campaign TreeUber · PHONE SCREENUber interview questions
  • Camel CardsRippling · PHONE SCREEN · ONSITE INTERVIEWRippling interview questions
  • Build a Pivot Table with TotalsSigma Computing · PHONE SCREEN
  • Structured Log Stream with QueriesOpenAI · PHONE SCREENOpenAI interview questions
  • Banking System with Pending Transfer AcceptanceCircle · PHONE SCREENCircle interview questions
  • Recent Metrics by Name and TagsVercel · PHONE SCREEN
  • Streaming Top-K Frequent ElementsNVIDIA · PHONE SCREENNVIDIA interview questions
  • Text Embedding and Vector SearchNike, Inc. · PHONE SCREEN · ONSITE INTERVIEWNike, Inc. interview questions
  • Interview Slot BookingTrueFoundry · PHONE SCREEN

Bloomberg LP interview experiences

  • Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
  • Bloomberg SWE Intern Interview Questions: 68 Questions
  • Bloomberg Interview Questions, Level Not Reported: 65 Questions
  • Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
  • Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 of 2)
  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public String[] rankBrowserHistory(String[] visits) {
      // Write your code here.
    }
}
Checking account…