FastPrepDocument Enrichment Stream Aggregator
Problems/Document Enrichment Stream Aggregator

Document Enrichment Stream Aggregator

Bloomberg LP logoBloomberg LP● HardNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Bloomberg new grad phone screen. The report gives the rule that required enrichments are collected, events that do not matter are filtered out, a document is published only once, and there is a ten-second timeout. We added a finite model of operations, a fixed order when several expire at the same time, how the return value is written, and the input limits. Our version is about 91% the same as the reported question.

Given requiredEnrichers and operations, return every document publication in the order it happens. Each document is published at most once.

requiredEnrichers lists unique enricher IDs in their configured order. Process the rows of operations one by one. Their timestamps are nondecreasing, so each one is the same as or later than the one before.

  • ["event", timestamp, documentId, enricherId, enrichment] is an event: enricher enricherId sends the value enrichment for document documentId.
  • ["advance", timestamp] only moves time forward. No event arrives.

Follow these rules:

  • Ignore events from an enricher that is not in requiredEnrichers. They do not start a timer.
  • A document's deadline is ten seconds after its first event from a required enricher.
  • If a required enricher sends a document more than one value, keep the latest one.
  • When an event gives a document its last missing required enricher, publish that document right away.
  • Before you process an operation at time t, publish every waiting document whose deadline is at most t. Publish them by ascending deadline. Break ties by document ID in lexicographic order, which compares the IDs character by character.
  • After a document is published, ignore every later event for it.

Each publication row starts with the document ID. Then come enricherId, enrichment pairs for the required enrichers the document has, in configured order. A document published at its deadline leaves out the enrichers it never received.

Function

aggregateEnrichments(requiredEnrichers: String[], operations: String[][]) → String[][]

Examples

Example 1

requiredEnrichers = ["Sentiment Analysis","Entity Linking"]operations = [["event","0","doc1","Sentiment Analysis","positive"],["event","1","doc2","Entity Linking","[\"AAPL\"]"],["event","2","doc1","Topic Classification","[\"AUTO\"]"],["event","3","doc1","Entity Linking","[\"TSLA\"]"],["advance","11"]]return = [["doc1","Sentiment Analysis","positive","Entity Linking","[\"TSLA\"]"],["doc2","Entity Linking","[\"AAPL\"]"]]

doc1 publishes immediately at time 3 with both required enrichments. The topic event is ignored. At time 11, doc2 reaches its deadline and publishes with only Entity Linking.

Example 2

requiredEnrichers = ["A","B"]operations = [["event","0","docB","A","x"],["event","0","docA","A","y"],["event","10","docC","A","z"],["advance","20"]]return = [["docA","A","y"],["docB","A","x"],["docC","A","z"]]

Before the event at time 10 is processed, docA and docB both reach their deadline. They tie, so docA comes first by document ID. docC then reaches its deadline at time 20.

Example 3

requiredEnrichers = ["A","B"]operations = [["event","0","doc","A","old"],["event","1","doc","A","new"],["event","2","doc","B","done"]]return = [["doc","A","new","B","done"]]

The second A event replaces the first value. The B event completes the document, which publishes immediately with the latest configured values.

Constraints

  • 1 <= requiredEnrichers.length <= 20.
  • Required enricher IDs are unique.
  • 1 <= operations.length <= 100000.
  • Operation timestamps are nondecreasing integers from 0 through 1000000000.
  • Document IDs, enricher IDs, and enrichment strings contain between 1 and 100 visible ASCII characters.
  • Every operation has exactly the fields required by its type.

More Bloomberg LP Phone Screen questions

  • Collatz Conjecture with Shared MemoizationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE 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

Similar questions at other companies

  • Progressive Banking SystemAirbnb · OAAirbnb interview questions
  • Cloud Compute Credits SystemCoinbase · OACoinbase interview questions
  • 15-Minute Chat Session TrackerOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
  • Capacity-Limited Timed CacheNetflix · PHONE SCREENNetflix interview questions
  • Tiered Expiring Item StoreHudson River Trading · PHONE SCREEN · ONSITE INTERVIEWHudson River Trading interview questions
  • Streaming Top K Frequent ElementsAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Tiered Expiring Item StoreAkuna Capital · PHONE SCREENAkuna Capital interview questions
  • Multi-Level Inventory Storage SystemOptiver · OA · PHONE SCREENOptiver interview questions
  • Limit Order Book Matching EngineCitadel · PHONE SCREEN · ONSITE INTERVIEWCitadel interview questions
  • In-Memory Database with TTL and Historical QueriesZip · PHONE SCREENZip interview questions

Interview reports that mention this question

  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
  • Bloomberg New Grad Interviews: 2025 vs 2026 Guide
  • Bloomberg New Grad SWE Interviews: 98 Experiences (Part 1 of 5)

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
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public String[][] aggregateEnrichments(String[] requiredEnrichers, String[][] operations) {
        // Write your code here.
    }

}
Checking account…