Uber OA is a critical hurdle for engineering and data science candidates, designed to evaluate problem-solving skills, algorithmic thinking, and domain-specific knowledge. Uber OA typically includes coding challenges and analytical problems tailored to Uber's business needs, such as ride-sharing logistics, route optimization, and real-time data processing. Uber OA typically includes coding challenges and analytical problems tailored to Uber's business needs, such as ride-sharing logistics, route optimization, and real-time data processing.
Introduction to Uber OA
Uber's OA varies by role but often includes.
- Coding Questions:: Focus on data structures, algorithms, and efficiency (e.g., graphs for route planning).
- System Design Elements:: High-level design thinking for scalability (common in senior roles).
- Behavioral/Logical Questions: Problem-solving under time pressure; Uber values balancing correctness with practicality.
Practice clear, efficient code with careful handling of edge cases.
Uber OA Practice Questions
1. Ride Matching with Dynamic Pricing
Problem:
Uber needs to match drivers to riders based on proximity and dynamic pricing. given an N x N grid, each cell is a location. Drivers and riders are at specific coordinates. Each rider has a price they're willing to pay, and each driver has a max_distance They can travel.
Task.
For each rider, find the nearest driver within their max_distance who can reach them at or below their price. return a list of (rider_index, driver_index) pairs, using the lowest price (if prices tie, choose the closer driver).
Input:
drivers: List of(x, y, max_distance, price_per_km)riders: List of(x, y, max_distance, max_price)
Output:
List of (rider_index, driver_index) or -1 if no match.
Example:
drivers = [(1, 2, 5, 2), (3, 4, 3, 3)]
riders = [(2, 3, 4, 10), (5, 6, 2, 5)]
Output:
[(0, 0), (1, -1)]
Explanation:
Rider 0 at (2,3) is within 4 km of Driver 0 at (1,2) (distance ≈ 1.414 km). Cost ≈ 1.414 × 2 = 2.83 ≤ 10.
Rider 1 at (5,6) is ≈2.828 km from Driver 1; exceeds max_distance.
2. Trip Duration Prediction
Problem:
Predict trip durations based on historical data. Given trips with (start_time, end_time, distance, traffic_condition), estimate the duration of a new trip. Given trips with (start_time, end_time, distance, traffic_condition)
Task.
Calculate the average duration for trips in distance buckets (0-5 miles, 5-10 miles, >10 miles) and matching traffic conditions.
Input: trips: List of (start_time, end_time, distance, traffic_condition)
new_trip: (distance, traffic_condition)
Output:
Average duration in minutes for the matching bucket, or -1 if no data exists.
Example:trips = [
("2023-10-01 10:00:00", "2023-10-01 10:20:00", 3, "low").
("2023-10-01 11:30:00", "2023-10-01 12:10:00", 7, "medium").
("2023-10-02 08:00:00", "2023-10-02 09:30:00", 15, "high").
]
new_trip = (6, "medium")
Output: 40
Explanation:
The new trip is in the 5-10 miles / "medium" bucket; the 7 mile example averaged 40 minutes.
3. Driver Scheduling with Availability Windows
Problem:
Drivers set availability windows (start_available, end_available). Given a trip request with trip_start and duration, find all drivers whose availability covers the entire trip.
Task.
Return (count, [driver_ids]), sorted by availability start time.
Input:
drivers: List of (driver_id, start_available, end_available)
trip_start: Integer (e.g., Unix timestamp)
trip_duration: Integer (minutes)
Example:drivers = [
(123, 1000, 1500),
(456, 1200, 1600),
(789, 900, 1100),
]
trip_start = 1100
trip_duration = 200 # ends at 1300
Output: (2, [123, 456])
Stress-Free Exam Support!
Overwhelmed by exams? Programhelp's professional exam proxy services deliver precise, efficient results-helping you pass with ease. Get in touch today for a customized plan!