profile pic # Data Engineering @ Uber
Upvote 0 Downvote
Consecutive Logins and Activity Analysis Using SQL Data Engineer @ Uber Difficulty Hard
  1. Consecutive Days Logins: Given a table logins with columns user_id and login_date, find users who logged in on two consecutive days.

  2. Users with All Activities: Given a table activities with columns user_id and activity, find users who have performed all three activities: 'login', 'purchase', and 'logout'.

  3. Ranking Products by Price: Given a table products with columns product_id and price, rank the products by price without using the RANK() function.

  4. Second Highest Salary: Given a table employees with columns employee_id and salary, find the second highest salary.

  5. Duplicate Email Addresses: Given a table users with an email column, find all email addresses that appear more than once.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
SQL Queries and Basic Python Questions Data Engineer @ Uber Difficulty Medium
  1. SQL Query for Top N Records: Write an SQL query to fetch the top 5 employees with the highest salaries from an employees table with columns employee_id, name, and salary.

  2. SQL Query for Aggregate Function: Write an SQL query to find the average salary of employees in each department from a table employees with columns department_id, employee_id, and salary.

  3. Python Function for Factorial: Write a Python function to compute the factorial of a given number.

  4. Python List Comprehension: Write a Python one-liner using list comprehension to create a list of squares of the first 10 natural numbers.

  5. Python String Manipulation: Write a Python function to reverse a given string.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Check if One String is a Rotation of Another Software Engineer @ Uber Difficulty Medium

Given two strings s1 and s2, write a Python function to check if s1 is a rotation of s2. Provide an explanation and the solution.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Rental Car Service Design System Architect @ Uber Difficulty Hard

Design a rental car service. Your solution should include considerations for the following aspects:

  1. Database Schema: Outline the schema for storing information about cars, rentals, and customers.
  2. Microservices Architecture: Describe the microservices that would be necessary for this system.
  3. API Endpoints: List key API endpoints for managing car rentals, including adding a new rental, returning a car, and checking car availability.
  4. Scalability: Discuss how you would ensure the system scales to handle a large number of rental transactions.
Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Combining Data Sets and Posting to an API Software Engineer @ Uber Difficulty Medium

Given two data sets, build a Python application to combine the data and post the combined data into an API. Describe the approach and provide a sample implementation.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Accelerating Processing of Large Data Set Data Engineer @ Uber Difficulty Hard

Given a data set of 60 million records and an O(n) computation that takes 2 weeks to complete on a single computer, how would you accelerate the processing time to be completed within 24 hours? Describe your approach and the technologies you would use.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
MapReduce, IP Pool Management, and Rotated Array Search Data Engineer @ Uber Difficulty Hard
  1. MapReduce Random Lines from Large Log Files: Using the MapReduce framework, how would you get X amount of random lines from large log files?

  2. Managing a Pool of IPs: Describe how you would design a system to manage a pool of IP addresses, ensuring efficient allocation and deallocation.

  3. Rotated Array Search: Given a rotated sorted array, write a Python function to search for a target value. Explain your approach and provide the solution.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Function to Calculate Square Root with Precision and Caching Software Engineer @ Uber Difficulty Medium

Implement a function in Python to calculate the square root of any given number up to 2 decimal points precision. Then, optimize the function and implement a caching mechanism to eliminate redundant calculations. Provide an explanation and the solution.

Solution:

Please sign-in to view the solution