PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Software Engineering Fundamentals/Uber

Improve robustness of graph cycle detection code

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's competence in software engineering fundamentals—covering graph algorithms and dependency analysis, scalability and memory considerations, error handling and observability, testing strategy, and API and extensibility design for production systems.

  • medium
  • Uber
  • Software Engineering Fundamentals
  • Software Engineer

Improve robustness of graph cycle detection code

Company: Uber

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Technical Screen

You have written code to detect cycles in a directed dependency graph of services, where nodes represent services and edges represent dependencies between services. In a real-world production environment, this code will be part of a larger system that validates service configurations before deployment. **Question:** How would you improve this cycle detection component so that it works better in a real-world setting? Discuss considerations and potential improvements in areas such as: - Code readability and maintainability - Handling large-scale graphs (performance, memory) - Error handling and edge cases (e.g., invalid or missing data) - Logging, monitoring, and observability - Testing strategy (unit tests, integration tests, property-based tests) - API design (inputs/outputs, how results are surfaced to other services or to users) - Extensibility for future requirements (e.g., reporting all cycles, not just existence) Provide concrete examples and rationale for the improvements you propose.

Quick Answer: This question evaluates a candidate's competence in software engineering fundamentals—covering graph algorithms and dependency analysis, scalability and memory considerations, error handling and observability, testing strategy, and API and extensibility design for production systems.

Related Interview Questions

  • Design a Real-Time Top-K Ranking System - Uber (hard)
  • Design a Parking Lot - Uber (medium)
  • Design a Parking Garage Object Model - Uber (medium)
  • Design follow/follower classes - Uber (medium)
  • Design a meeting room reservation API - Uber (medium)
Uber logo
Uber
Dec 8, 2025, 6:42 PM
Software Engineer
Technical Screen
Software Engineering Fundamentals
3
0

You have written code to detect cycles in a directed dependency graph of services, where nodes represent services and edges represent dependencies between services.

In a real-world production environment, this code will be part of a larger system that validates service configurations before deployment.

Question:

How would you improve this cycle detection component so that it works better in a real-world setting? Discuss considerations and potential improvements in areas such as:

  • Code readability and maintainability
  • Handling large-scale graphs (performance, memory)
  • Error handling and edge cases (e.g., invalid or missing data)
  • Logging, monitoring, and observability
  • Testing strategy (unit tests, integration tests, property-based tests)
  • API design (inputs/outputs, how results are surfaced to other services or to users)
  • Extensibility for future requirements (e.g., reporting all cycles, not just existence)

Provide concrete examples and rationale for the improvements you propose.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Uber•More Software Engineer•Uber Software Engineer•Uber Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
PracHub

Master your tech interviews with 7,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.