PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Coding & Algorithms/Databricks

Solve graph path, interval deletion, and robbery

Last updated: Mar 29, 2026

Quick Overview

This multipart problem evaluates proficiency with constrained graph shortest-path algorithms, dynamic programming for circular non-adjacent selection, and interval-set manipulation with streaming and data-structure design, measuring algorithm selection and time/space complexity analysis skills.

  • Medium
  • Databricks
  • Coding & Algorithms
  • Software Engineer

Solve graph path, interval deletion, and robbery

Company: Databricks

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: HR Screen

Part A — Optimal path with transport modes: You are given a directed weighted graph of a city. Each edge has a travel time and a transport mode label (e.g., walk, bus, subway, bike). Given a source s, destination t, and a set of allowed modes, compute the minimum-time path that only uses edges whose mode is in the allowed set. Describe your algorithm and analyze time/space complexity. Follow-up: if all modes are allowed (no restriction), what algorithm would you choose and why? How do your complexity and implementation details change? Part B — Maximize non-adjacent loot on a circle: Given n non-negative integers where nums[i] is the cash in the i-th house arranged in a circle, compute the maximum cash you can steal if you cannot rob two adjacent houses and the first and last houses are adjacent and cannot both be robbed. Explain your approach and its complexity. Part C — Delete an interval, incl. streaming: You are given a sorted list of non-overlapping half-open intervals [start, end). Implement a function deleteInterval(intervals, del) that removes del from intervals (possibly splitting intervals) and returns the remaining intervals. Follow-up: how would you process a high-throughput stream of delete intervals online? What data structures would you use to keep operations efficient and memory-bounded? Analyze complexities.

Quick Answer: This multipart problem evaluates proficiency with constrained graph shortest-path algorithms, dynamic programming for circular non-adjacent selection, and interval-set manipulation with streaming and data-structure design, measuring algorithm selection and time/space complexity analysis skills.

Related Interview Questions

  • Find the Best Commute Mode - Databricks (medium)
  • Partition a Target String by Source Substrings - Databricks (medium)
  • Design In-Memory QPS Counter - Databricks (medium)
  • Implement Random Connectivity and Grid Routing - Databricks
  • Implement a Snapshot Set Iterator - Databricks (hard)
Databricks logo
Databricks
Aug 9, 2025, 12:00 AM
Software Engineer
HR Screen
Coding & Algorithms
13
0

Part A — Optimal path with transport modes: You are given a directed weighted graph of a city. Each edge has a travel time and a transport mode label (e.g., walk, bus, subway, bike). Given a source s, destination t, and a set of allowed modes, compute the minimum-time path that only uses edges whose mode is in the allowed set. Describe your algorithm and analyze time/space complexity. Follow-up: if all modes are allowed (no restriction), what algorithm would you choose and why? How do your complexity and implementation details change?

Part B — Maximize non-adjacent loot on a circle: Given n non-negative integers where nums[i] is the cash in the i-th house arranged in a circle, compute the maximum cash you can steal if you cannot rob two adjacent houses and the first and last houses are adjacent and cannot both be robbed. Explain your approach and its complexity.

Part C — Delete an interval, incl. streaming: You are given a sorted list of non-overlapping half-open intervals [start, end). Implement a function deleteInterval(intervals, del) that removes del from intervals (possibly splitting intervals) and returns the remaining intervals. Follow-up: how would you process a high-throughput stream of delete intervals online? What data structures would you use to keep operations efficient and memory-bounded? Analyze complexities.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Databricks•More Software Engineer•Databricks Software Engineer•Databricks Coding & Algorithms•Software Engineer Coding & Algorithms
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.