PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Elastic

Implement log aggregation in React

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's front-end development and real-time data-aggregation skills, specifically React component state management, handling streaming updates, choosing appropriate in-memory data structures (e.g., Map), and timestamp parsing/comparison for per-category frequency and last-update tracking.

  • medium
  • Elastic
  • Coding & Algorithms
  • Software Engineer

Implement log aggregation in React

Company: Elastic

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

## React Coding: Log stream aggregation You are building a small React feature that displays real-time statistics from a log stream. ### Log event format Each incoming event has: - `category`: string (e.g., `"auth"`, `"payments"`) - `timestamp`: ISO-8601 string or epoch milliseconds (time the event occurred) Example event: ```json { "category": "auth", "timestamp": "2025-12-15T10:15:30Z" } ``` ### Requirements Implement a React component (or a small set of components) that: 1. Consumes a stream of log events (assume you receive events one-by-one via a callback like `onEvent(event)` or via a mocked interval). 2. Maintains an in-memory aggregation keyed by `category`. 3. For each category, displays: - **frequency**: total number of events seen for that category - **last update time**: the most recent `timestamp` seen for that category 4. Renders the aggregation as a table/list that updates live as events arrive. ### Constraints / notes - Use a `Map` (or justify an alternative) to store per-category stats. - Handle new categories appearing at any time. - Clarify how you handle timestamps (e.g., parse/compare) and what you display if there are no events.

Quick Answer: This question evaluates a candidate's front-end development and real-time data-aggregation skills, specifically React component state management, handling streaming updates, choosing appropriate in-memory data structures (e.g., Map), and timestamp parsing/comparison for per-category frequency and last-update tracking.

Elastic logo
Elastic
Nov 13, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
4
0

React Coding: Log stream aggregation

You are building a small React feature that displays real-time statistics from a log stream.

Log event format

Each incoming event has:

  • category : string (e.g., "auth" , "payments" )
  • timestamp : ISO-8601 string or epoch milliseconds (time the event occurred)

Example event:

{ "category": "auth", "timestamp": "2025-12-15T10:15:30Z" }

Requirements

Implement a React component (or a small set of components) that:

  1. Consumes a stream of log events (assume you receive events one-by-one via a callback like onEvent(event) or via a mocked interval).
  2. Maintains an in-memory aggregation keyed by category .
  3. For each category, displays:
    • frequency : total number of events seen for that category
    • last update time : the most recent timestamp seen for that category
  4. Renders the aggregation as a table/list that updates live as events arrive.

Constraints / notes

  • Use a Map (or justify an alternative) to store per-category stats.
  • Handle new categories appearing at any time.
  • Clarify how you handle timestamps (e.g., parse/compare) and what you display if there are no events.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Elastic•More Software Engineer•Elastic Software Engineer•Elastic Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.