PracHub
QuestionsCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates a candidate's ability to analyze and implement efficient data-processing and frequency-detection strategies on ordered string sequences, with attention to time and memory complexity.

  • medium
  • Uber
  • Coding & Algorithms
  • Software Engineer

Find the First Unique Log

Company: Uber

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

You are given a list of log entries in the order they were produced. Each log entry can be treated as a string. Return the first log entry that appears exactly once in the entire list. If no such log entry exists, return `null` or an equivalent empty result. Example: Input: `["login", "click", "logout", "login", "purchase", "click"]` Output: `"logout"` Follow-up: How would your approach change if the input contains about 10 million log entries? Discuss time complexity, memory usage, and any practical considerations for large-scale processing.

Quick Answer: This question evaluates a candidate's ability to analyze and implement efficient data-processing and frequency-detection strategies on ordered string sequences, with attention to time and memory complexity.

Given log entries in production order, return the first entry that appears exactly once in the whole list. Return None when every entry repeats.

Constraints

  • logs length can be large
  • log entries are strings

Examples

Input: (['login', 'click', 'logout', 'login', 'purchase', 'click'],)

Expected Output: 'logout'

Input: (['a', 'b', 'a', 'b'],)

Expected Output: None

Input: ([],)

Expected Output: None

Input: (['same', 'unique', 'same', 'later'],)

Expected Output: 'unique'

Hints

  1. Count frequencies first, then scan in original order.
Last updated: Jun 27, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,000+ 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
  • AI Coding 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.

Related Coding Questions

  • Deep Equality of Two Records - Uber (medium)
  • Shortest Path in a Grid with Blocked Cells - Uber (medium)
  • Design and Implement an LRU Cache - Uber (medium)
  • Reconstruct the Alphabet Order of an Alien Language - Uber (medium)
  • Maximize Throughput and Count Trigger Components - Uber (medium)