Skip to main content
All Questions

Find the timestamp at which all users become connected, given a connection log.

Unlock detailed company stats for this questionUpgrade

Earliest Timestamp When All Users Become Connected. Logs have the form '<timestamp> <UserA> shared ride with <UserB>', sorted by timestamp; each log connects UserA and UserB at that timestamp. Determine the earliest timestamp at which all users in the system are connected.

Follow-up: a second log type '<timestamp> <UserA> cancel ride with <UserB>' removes the connection between the two users. Determine the earliest timestamp at which all users are connected, considering removals.

Expect follow-ups like

  • Find the timestamp after which the maximum number of connections between any two nodes is at most k (fixed), and all users are connected.
  • Logs can now also include 'timestamp, userB unfriends userC' - find the timestamp when all users are connected.
  • Logs can also contain '<timestamp> <UserA> cancel ride with <UserB>', which removes the connection - now find the earliest timestamp at which all users are connected.

Format · Uber SDE I elimination round, Feb 2026.

Also asked as · Find the earliest timestamp at which all users become connected.

Community answers

No answers contributed by the community yet.

Related courses

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.