Before you go!

Take this "Uber Interview Questions" interview guide with you

Welcome to Interviewbit, help us create the best experience for you!

Currently, You are a:

Few details about your education

College/University *
Enter the name of your college
Branch *
Year of completion *

Few details about your education

College/University *
Enter the name of your college
Branch *
Year of completion *

Few details about your career...

Current Company *
Enter company name
Experience *

You're all set!

Begin your success journey!

Sign Up using
Full name *
Email *
Password *

By creating an account, I acknowledge that I have read and agree to InterviewBit’s Terms and Privacy Policy .

Welcome back!

Log In using
Email *
Password *

Uber Interview Questions

Begin your success journey!

Sign Up using
Full name *
Email *
Password *

By creating an account, I acknowledge that I have read and agree to InterviewBit’s Terms and Privacy Policy .

Welcome back!

Log In using
Email *
Password *

About Uber

Uber is one of the most popular Software Companies in the world today which solves huge real-life problems at scale. The technology used at Uber is cutting edge and it gives a chance for the engineers over there to apply their skills to the best of their abilities and work on these technologies to come up with inspiring solutions to various real-life problems. Therefore, whether be it a budding engineer or an experienced professional, it would always be beneficial for one to join this amazing company given the immense exposure one would get at Uber. Also, Uber engineers are compensated heavily, way above the industry standards, which is another big incentive to join Uber as one's place of work. 

So, if you are preparing for an Uber tech interview, this article will help you prepare by listing down the various Uber interview questions (both for freshers and experienced personnel) and interview rounds. We will also go over some helpful hints for cracking the Uber interviews and getting a job at this amazing company. 

Uber Recruitment Process

Interview Process

Like other interviews, the Uber interview process begins with a candidate applying for a job position. If someone is a good fit for the job, Uber will schedule an interview with you. Uber recruiters may also propose roles that are a better fit for your profile than the one you applied for. You will then go through a technical phone screen and a series of on-site or online interviews after being shortlisted. Each phone screen and the on-site interview lasts about 60 minutes in most circumstances. So, to summarise, the Uber Interview process consists of the following steps:

  1. Online Test (On platforms like Hackkerank, HackerEarth, etc.)
  2. On-site or Online Technical Interview Rounds
  3. One System Design Round
  4. Human Resources or HR Round. 

Interview Rounds

1. Online Test (Coding Round): The online test of Uber is of medium to hard difficulty and very critically evaluates the problem-solving ability of an individual. It is usually a coding round that is conducted on platforms like Hackkerank, HackerEarth, etc. and the candidates are asked to solve two to three questions based on Data Structures and Algorithms. These questions require the candidates to apply their problem-solving skills and knowledge of various Data Structures and Algorithms to solve the given problem. The candidates then have to code their solution in a programming language of their choice, for instance, C++, Java, Python, etc. This round can be skipped for experienced folks as seems necessary to the Recruiters.

2. On-site or Online Technical Interviews: The Uber on-site or online Technical interviews will entail a series of four to six face to face interviews. To tackle the challenges, your interviewers will either ask you to use HackerRank or a whiteboard. One can expect five to ten minutes of conversation on previous work experience in each interview, as well as situational and behavioural interview questions. A series of questions about Data Structures and Algorithms are asked after that. The interviewing panel may also the candidate to code their responses for them, who will evaluate the code quality, logic, and other issues. The candidate's technical expertise is then assessed through a series of questions.

To pass these Uber walk-in-interview rounds, you must have a strong understanding of computer science principles. Candidates should be knowledgeable with data structures and algorithms, database management systems, operating systems, networking, object-oriented programming ideas, and their preferred programming languages, such as C++, Java, Python, and others. During this stage, if the candidate is an experienced Software Engineer, a few questions on their previous internship experiences and projects may be asked. The panel will also ask you questions on your resume, so make sure you understand everything you've written. The Uber technical interview questions are similarly of a moderate to the high difficulty level.

The last five to ten minutes are all yours! One can inquire about the employment role with the interviewer. One can also prepare a list of questions about your employment, the project or division for which you are applying, and other relevant facts such as employee diversity, inclusion policies, and so on and so forth. These rounds are also eliminative in nature. A thing to note over here is that there can be multiple technical interviews based on requirements and previous interview performances of the candidate as seen fit by the recruiters.

3. System Design Round: After a series of interviews on technical skills, candidates are assessed for their ability to design distributed systems. For freshers, the interviewers usually ask the candidates to use Object-Oriented programming to create the design for a product on a high level by asking them to classify the important features of the system first. Later on, the candidates are asked to scale the solution they have come up with using various concepts like Load balancing, caching, etc. It is important to add only the necessary features for the solution you are developing in this round and communicate well with the interviewer so that they can relate to the system being built. Learn More.

4. The Human Resources (HR) or Managerial Round: The Human Resources or HR round of the Uber Recruitment Process aims to determine whether or not the candidate is a cultural match for Uber. Candidates should learn more about Uber and Uber products in order to ace these interviews. 

During these rounds, candidates may be asked puzzle based questions to determine their overall intelligence and how effectively they react to awkward and challenging situations. If an applicant meets all of the above criteria and has demonstrated great technical talents in previous rounds, he or she will almost certainly be hired at Uber, India. The following are some of the questions that may be asked during the Human Resources or HR round:

  • What are some of your strengths and weaknesses?
  • What is the reason behind you wanting to join Uber?
  • Please provide me with some information which you know about Uber.
  • What value do you bring to Uber, and how do you see yourself making a difference in the world while there?
  • Is it conceivable for you to migrate to a different region of the country?
  • Describe yourself and what you know about yourself.
  • What drew you to Uber in the first place?
  • What do you believe your pay will be?

Uber Technical Interview Questions: Freshers and Experienced

1. Write functional code for solving the problem given below

"You have been given the string s (which consists of only uppercase English characters) and the integer k. You can replace any character in the string with another uppercase English character. This operation can be performed at most k times. After executing the preceding procedures, return the length of the longest substring containing the same letter." 

Sample input and output is shown below:

Input: s = "AABABBA", k = 1
Output: 4

C ++ function which solves the given Data Structures and Algorithm problem is given below:

int replaceCharacters(string s, int k) {
        int n = s.length();
        int maxLength = 0, maxFreq = 0, l = 0;
        vector<int> freq(26);
        for(int r = 0; r < n; r ++){
            int ascii = s[r] - 'A';
            freq[ascii] ++;
            maxFreq = max(maxFreq, freq[ascii]);
            while(r - l + 1 - maxFreq > k){
                freq[s[l] - 'A'] --;
                l ++;
            }
            maxLength = max(maxLength, r - l + 1);
        }
        return maxLength;
    }

In this question, we use the sliding window technique along with two pointers "l" and "r" to get our answer. We keep moving the pointer "r" by one from left to right each iteration and update the frequency of all characters in the window starting from index l to r. If the difference of the subarray length l to r and maximum frequency among all the characters in the window of l to r is greater than the given value k, we move l forward until the same condition does not hold (l's value is incremented hence subarray length, that is, the value of "r - l + 1" keeps decreasing). In the end, we update our answer variable with the value of the length of the subarray "r - l + 1" since we can guarantee that after performing at most k op, all characters in the subarray can be made the same.

2. Write functional code for solving the problem given below:

Return the result of a sequence of enqueue and dequeue actions without utilising a queue data structure. The following op are presented in the form of a linked list: 

  • A non-negative integer denotes "enqueue me." 
  • -1 denotes either of the following:
    • Dequeue the current root and append it to the result if the queue is not empty.
    • Append -1 to the result if the queue is empty.

The end result should be returned as a linked list. As an auxiliary data structure, use two stacks. It is not permitted to use a queue.

C ++ code snippet which solves the given Data Structures and Algorithm problem is given below:

Node* makeAnswerList(Node *root, Node *last, int value)
{
    if (root == NULL)
    {
        root = new Node(value);
        last = root;
    }
    else
    {
        Node *node = new Node(value);
        last->link = node;
        last = last->link;
    }
    return last;
}

int dequeue(stack &stk1, stack &stk2)
{
    if (stk1.empty() && stk2.empty())
    {
        return -1;
    }

    // If the second stack is not empty, popping and returning from it.
    if (stk2.empty() == false)
    {
        int value = stk2.top();
        stk2.pop();
        return value;
    }

    /* Otherwise we pop each and every element from the first stack and push into the second stack. */
    while (stk1.empty() == false)
    {
        stk2.push(stk1.top());
        stk1.pop();
    }

    // Lastly, we pop and return the root of the second stack.
    int value = stk2.top();
    stk2.pop();
    return value;
}

Node* implementingQueue(Node* op)
{
    stack stk1, stk2;
    Node *root = NULL;
    Node *last = NULL;
    while (op != NULL)
    {
        if (op->val >= 0)
        {
            stk1.push(op->val);
        }
        else
        {
            last = makeAnswerList(root, last, dequeue(stk1, stk2));
            if (!root)
            {
                root = last;
            }
        }
        op = op->link;
    }
    return root;
}

In this question, we use two stacks to implement the queue data structure. As soon as a non-negative integer is found, we add it into the first stack and when we get a -1 in the input list, we perform the dequeue operation using the following criteria:

  • If the second stack is not empty, we return its topmost value and pop it.
  • If the second stack is empty, we pop all the elements of the first stack, push them into the second stack and at the end, we pop and return the topmost element of the second stack.

This way, the FIFO (First In First Out) property of a queue is preserved and we get our required answer list.

3. Write functional code for solving the problem given below:

Print the right view of a given binary tree. An example tree and its right view are shown below:

The right view of the following tree is 1 3 7 8

         1
      /     \
    2        3
  /   \     /  \
 4     5   6    7
                 \
                  8
C ++ code snippet which solves the given Data Structures and Algorithm problem is given below:

void foo(struct ListNode *head, int lvl, int &maximumLevel)
{
   // Base condition of this recursive function
   if (!root) return;

   // If this is the last Node of its level
   if (lvl > maximumLevel)
   {
       cout << head -> val << endl;
       maximumLevel = lvl;
   }

   /* Recurring for the right subtree first, followed by the left subtree */
   foo(head -> right, lvl + 1, maximumLevel);
   foo(head -> left, lvl + 1, maximumLevel);
}

// Function to print the right view of a binary tree
void printRightView(ListNode *head)
{
   int maximumLevel = 0;
   foo(head, 1, maximumLevel);
}

Simple recursive traversal can be used to solve the problem. By supplying a parameter to all recursive calls, we can maintain track of a node's level. The goal is to keep track of the maximum level as well. And traverse the tree in such a way that the right subtree comes first, followed by the left subtree. When we see a node with a level greater than the greatest level so far, we print it because it is the last node in its level (Note that we traverse the right subtree before the left subtree). 

4. Write functional code for solving the problem given below: Detect whether or not a given linked list contains a cycle.

C ++ function which solves the given Data Structures and Algorithm problem is given below:

bool detectCycle(ListNode* root)
{
   ListNode *slow = root, *fast = root;

   while (slow && fast && fast -> link) {
       slow = slow->link;
       fast = fast->link->link;
       if (slow == fast) {
           return true;
       }
   }
   return false;
}

For solving this question, we can use Floyd's Approach to Find cycle in a linked list. It is stated below:

  • Two pointers are used for traversing the linked list.
  • One pointer (slow) should be moved by one, while another pointer (fast) should be moved by two.
  • There is a loop if these points intersect at the same node. A linked list does not have a loop if the pointers do not meet.

5. Write functional code for solving the problem given below:

Given a binary integer number n, convert it into base 6. There can be upto a hundred bits in the given number and the number is given as input in the form of a binary string. Sample input and output for the given problem is shown below:

Input: n = 10101
Output: 33

C ++ function which solves the given Data Structures and Algorithm problem is given below:

void conversionTpBaseSix(string n)
{
	// 128 bit integer, supported by C ++, is being used for storing the decimal conversion
	__int128 decimalValue = 0;

	// Looping for iterating over string n
	for (int j = 0; j < n.size(); j ++) {
		// converting Binary  to decimal number
		decimalValue = decimalValue * 2 + (n[j] - '0');
	}

	// Vector storing the answer as the base 6 integer
	vector<int> answer;

	// Decimal number converted to base 6 number
	while (decimalValue > 0) {
		answer.push_back(decimalValue % 6);
		decimalValue = decimalValue / 6;
	}

	// Printing the answer vector in reverse
	for (int j = answer.size() - 1; j >= 0; j --) {
		cout << answer[j];
	}
}

The given problem can be handled by first converting the given binary integer to a decimal number and then converting the number from decimal to base 6. Please keep in mind that because the value of N can go up to 2100, the 128-bit integer can be utilised to hold the decimal number.

6. Write functional code for solving the problem given below:

Given an array of both positive and negative numbers, find out the largest sum that can be achieved by considering any-one subarray of the given array. Sample input and output for the given problem is given below:

Input: arr = [5,-2,4,-2,1]
Output: 7 

C ++ function which solves the given Data Structures and Algorithm problem is given below:

int maximumSumOfSubarray(vector<int> arr)
{
  int n = arr.size();
  int res = 0;
  int curMax = 0;

  for (int j = 0; j < n; j ++)
  {
       curMax = max(arr[j], curMax + arr[j]);
       res = max(res, curMax);
  }
  return res;
}

We use Kadane's algorithm to solve this given problem. The basic idea behind Kadane's approach is to search the array for all positive contiguous segments (curMax is utilised for this) and maintain a record of the maximum sum contiguous segment among all positive segments (res is used for this). When we get a positive total, we compare it to the variable res and update the res variable if the sum found is bigger.

7. Write functional code for solving the problem given below:

An integer interval [A, B] is a collection of all successive integers between A and B, including A and B. You are given a 2D array A of dimensions N x 2, with each row representing an interval. Find the smallest size of a set S such that the intersection of S with Z has a size of at least two for every integer interval Z in A. Sample input and output for this problem is given below:

Input: a = [[1, 3], [1, 4], [2, 5], [3, 5]]
Output: 3

C ++ function which solves the given Data Structures and Algorithm problem is given below:

int findIntersectingSet(vector<vector<int> > &a) {
        int length = a.size();
        sort(a.begin(), a.end(), [&](vector<int> A, vector<int> B){
            if(A[1] != B[1])
                return A[1] < B[1];
            return A[0] < B[0];
        });
        vector<int> answer;
        answer.push_back(a[0][1] - 1);
        answer.push_back(a[0][1]); 
        for (int j = 1; j < length; j ++) {
            int s = a[j][0];
            int e = a[j][1];
            int sizeOfAnswer = answer.size();
            int lastAddedNumber = answer[sizeOfAnswer - 1];
            int secondLastAddedNumber = answer[sizeOfAnswer - 2];
            if (s > lastAddedNumber) {
                answer.push_back(e - 1);
                answer.push_back(e);
            } else if (s == lastAddedNumber) {
                answer.push_back(e);
            }
            else if (s > secondLastAddedNumber ) {
                answer.push_back(e);
            }
        }
        return answer.size();
}

In order to solve this problem, we must arrange the intervals by the right border first (ascending), followed by the left border (ascending). Then we add the first interval's end and end - 1. Then we look at the current interval's boundaries. To make the present interval fit the problem condition, we must either add zero, one, or at most two points.

8. Write functional code for solving the problem given below:

You are provided with an array containing n non-negative numbers, as well as a non-negative number sum. You must determine the number of subarrays in a whose sum is less than the sum. We can make the assumption that there is no overflow. Sample input and output for the given problem is as follows:

Input: a = [2, 5, 6]
         sum = 10
Output: 4

C ++ function which solves the given Data Structures and Algorithm problem is given below:

int foo(vector<int> &a, int sum) {
   int answer = 0;
   int s = 0, left = 0,right = 0;
   while(right < a.size()){
       s += a[right];
       while(s >= sum){
           s -= a[left ++];
       }
       answer += (right - left + 1);
       right ++;
   }
   return answer;
}

The sliding window technique is an efficient solution that can be utilised to tackle the problem. We utilise two pointers, left and right, to indicate the sliding window's beginning and ending points. Initially, both left and right point to the array's beginning, i.e. index 0. Let's try adding a new element from the array. There are two probable outcomes:

  • In the first scenario, if the sum is smaller than the sum, increment the right by one position. As a result, the contiguous arrays produced by this phase are (right-left). We additionally add the current element to the preceding total. There are as many of these arrays as the window's length.
  • In the second case, the current subarray sum becomes more than or equal to the maximum allowed sum given, we must deduct the starting element from the total such that the sum becomes less than the maximum allowed sum given once more. As a result, we alter the window's left border by increasing the value of the left pointer.

We repeat this technique until the right pointer reaches the end of the array.

9. Write functional code for solving the problem given below:

You are at point 'A,' the top-left cell of a m X n matrix, and your destination is the point 'B,' the bottom-right cell of the same matrix. Your job is to find the total number of unique pathways from point ‘A’ to point ‘B’. In other words, you will be provided with the matrix dimensions as integers 'm' and 'n', and your objective will be to find the total number of unique paths from the cell arr[0][0] to arr[m - 1][n - 1]. At each phase, you can move either Right or Down in the matrix. For instance, in a given place arr[i] [j], you can go to arr[i + 1][j] or arr[i][j + 1]. Sample input and output for the given problem is as follows:

Input :  m = 2, n = 2;
Output : 2

C ++ function which solves the given Data Structures and Algorithm problem is given below:

int totalPathCount(int m, int n)
{
   /* Creating a two dimensional table for storing the answers of the subproblems*/
   int dp[m][n];

   // Total number of paths to reach any cell in the first column is 1
   for (int i = 0; i < m; i++)
       dp[i][0] = 1;

   // Total number of paths to reach any cell in the first row is 1
   for (int j = 0; j < n; j++)
       dp[0][j] = 1;

   // Calculating total number of paths for other cells in
   // bottom-up manner using dynamic programming
   for (int i = 1; i < m; i++) {
       for (int j = 1; j < n; j++)
       {
           dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
        }
   }
   return dp[m - 1][n - 1];
}

The given problem can be solved using dynamic programming. We can claim that the number of paths to reach any cell in the first column is one as one can only move downwards. Similarly, the number of paths to reach any cell in the first row is again one since one can only move rightwards. For the rest of the cells, we can calculate the total number of ways to reach it using the following recurring relation:

Arr[i][j] = Arr[i-1][j] + Arr[i][j-1]

10. Write functional code for solving the problem given below:

Using the following mapping, a message comprising characters from A to Z can be encoded into numbers:
'A' = "1" 'B" = "2"... 'Z" = "26"
To decode an encoded message, all of the digits must be gathered and then mapped back into letters using the opposite of the aforementioned mapping (there may be multiple ways). For example, "11106" can be translated as follows:

"KJF" with the grouping (11-10-6) 
"AAJF" with the grouping (1-1-10-6)

It should be noted that the grouping (1 11 06) is illegal since "06" cannot be mapped into 'F' because "6" differs from "06".

Return the number of ways to decode a string s that solely contains digits.

C ++ function which solves the given Data Structures and Algorithm problem is given below:

int numOfWaysToDecode(string s) {
       int n = s.length();
       vector<int> dp(n+1,0);
       
       dp[0]=1;
       if(s[0]!='0')
           dp[1]=1;
       
       for(int i=2;i<=n;i++){
           int op1 = s[i-1]-'0';
           int op2 = (s[i-2]-'0')*10 + (s[i-1]-'0');
           
           if(op1>=1)
               dp[i] += dp[i-1];
           if(op2>=10 && op2<=26)
               dp[i] += dp[i-2];
       }
       
       return dp[n];
   }

We use dynamic programming to solve this question. If we iterate over the number string given to us and if the current value is greater than zero, we can consider it as a single number and map it to a character allowed. So we just add the total value of the previous state to the current state as shown in the line:

dp[i] += dp[i - 1]

Now, we consider the last two numbers in the string (if possible) and check if we can consider them together for decoding. For that, the last two numbers should lie between 10 and 26 inclusive. So we check this condition and if it is true, the current state's value is incremented with the value of the state behind the current state by a difference of 2:

dp[i] += dp[i - 2] 

11. Write functional code for solving the problem given below:

Given an undirected tree, each node is assigned a weight. We must remove an edge in such a way that the difference between the sum of weights in one subtree and the sum of weights in the other subtree is as small as possible. 

So for the example given below, we have to remove an edge to reduce the subtree sum difference.

We have 6 edge deletion options in the below given tree:  
edge 0-1,  subtree sum difference = 21 - 2 = 19
edge 0-2,  subtree sum difference = 14 - 9 = 5
edge 0-3,  subtree sum difference = 15 - 8 = 7
edge 2-4,  subtree sum difference = 20 - 3 = 17
edge 2-5,  subtree sum difference = 18 - 5 = 13
edge 3-6,  subtree sum difference = 21 - 2 = 19

Clearly, we should remove the edge 0-2 in an optimal solution.

C ++ function which solves the given Data Structures and Algorithm problem is given below:

/* DFS traversal through edges helps us to calculate the subtree sum at every node and updates the difference between the subtrees */
void dfs(int s, int par, int sumTotal, 
       vector<int> adj[], int sub[], int& result) 
{ 
   int sum = sub[s]; 
 
   /* looping for all adjacent nodes except for the parent and 
       aggregating the sum over all subtrees */
   for (auto v: adj[s]) 
   { 
       if (v != par) 
       { 
           dfs(v, s, sumTotal, adj, sub, result); 
           sum += sub[v]; 
       } 
   } 
 
   // storing the sum for current node in its subtree index 
   sub[s] = sum; 
 
   /* For one side, the subtree sum has to be 'sum' and for the other side, the subtree sum has to be 'sumTotal - sum' and therefore,
   their difference is going to be sumTotal - 2*sum. We update our result's value using this */
   if (s != 0 && abs(sumTotal - 2*sum) < result) 
       result = abs(sumTotal - 2*sum); 
} 
 
// Function for returning the minimum subtree sum difference 
int getMinimumDiff(vector<int> value, vector<int> adj[], int n) 
{ 
   int sumTotal = 0; 
   int sub[n]; 
 
   /* Finding the total sum of the values in the tree and initialising subtree sum's by vertex values */
   for (int j = 0; j < n; j++) 
   { 
       sub[j] = value[j]; 
       sumTotal += value[j]; 
   } 
 
  int result = INT_MAX; 
 
   // a call to the dfs method at node 0 with parent as -1 
   dfs(0, -1, sumTotal, adj, sub, result); 
   return result; 
}

DFS can help us tackle this problem. One straightforward way is to delete each edge one by one and compare the subtree sum difference. Finally, select the bare minimum of them. This method requires a quadratic amount of time complexity. By calculating the sum of both subtrees using the entire sum of the tree, an efficient technique can solve this problem in linear time. We may obtain the sum of another tree by subtracting the sum of one subtree from the total sum of the tree; thus, the subtree sum difference can be computed at each node in O(1) time. First, we compute the weight of the entire tree, and then, while doing DFS at each node, we compute its subtree sum; by combining these two values, we can compute the subtree sum difference. Another array subtree is used in the following code to hold the sum of subtrees rooted at node i in subtree[i]. DFS is invoked with the current node index and the parent index each time to loop through the children at each node. Please see the code above for a better understanding.

12. Write functional code for solving the problem given below:

Print the Next Greater Element (NGE) for each element in an array. The Next Greater Element for an element x is the first greater element in the array on the right side of x. Consider the next greater element as -1 for elements for which no greater element exists. For example, The rightmost element of an array always has the next bigger element as -1. All elements in a decreasingly ordered array have the next greater element as -1. The next bigger elements for each element in the input array [3, 4, 1, 12] are as follows.

NGE 3 -> 4, 4 -> 12, 1 -> 12, 12 -> -1

C ++ function which solves the given Data Structures and Algorithm problem is given below:

vector<int> nextGreater(vector<int> a)
{
   int n = a.size();
   stack<int> st;
   vector<int> ans;
   /* pushing the first element into the stack */
   st.push(a[0]);

   // iterating for the remaining elements
   for (int j = 1; j < n; j ++)
   {

       if (st.empty()) {
           st.push(a[j]);
           continue;
       }

       /* if the stack is not empty, we are going to pop an element from the stack and if the popped element is lesser
       in value than the current element, then we:
       a) add the popped element to answer
       b) keep popping while elements are
       smaller and stack is not empty
      */
       while (st.empty() == false
              && st.top() < a[j])
       {
           answer.push_back(st.top());
           st.pop();
       }

       /* pushing the current element to stack so that we can find
       the next greater for it */
       st.push(a[j]);
   }

   /* for all the elements left in the stack after the iteration, we add -1 to our ans vector */
   while (st.empty() == false) {
       ans.push_back(-1);
       st.pop();
   }
   return ans;
}

We can solve this problem using a stack using the following algorithm:

  • Push the first element to the top of the stack.
  • Pick the remaining items one by one and repeat the next procedures in a loop.
  • We mark the current element as next.
  • If the stack is not empty, compare the top element of the stack to the next.
  • If the following element is greater than the top element, remove the element from the stack. The next bigger element for the popped element is next.
  • Continue popping off the stack as long as the popped element is smaller than the next. For all such popped elements, next becomes the next bigger element.
  • Finally, move on to the next item in the stack.
  • When the loop in step 2 is finished, remove all the elements from the stack and print -1 as the next element for them.

13. State your understanding of Distributed Database Management Systems with Transparency?

The transparent Distributed Database Management System is a type of database management system that hides the physical structure of the database from users. Physical structure, also known as physical storage structure, refers to the memory manager of a database management system and describes how data is saved on a disc. There is less abstraction as a result of this. In Distributed Database Management Systems (or DDBMS), there are four forms of transparency:

  • Transparency in transactions.
  • Transparency in performance.
  • Transparency in relational databases.
  • Transparency in distribution.

14. What exactly is a Bootstrap Program in terms of operating systems?

A Bootstrap Program is typically a program that initialises the operating system during the startup of a computer system, in other words, the first program that runs when a computer system starts up. Booting is a method or application for loading the operating system. Overall, the bootstrap program is completely responsible for the operating system's performance and functionality. It is totally stored in boot blocks at a specific spot on the disc. It also locates and loads the kernel into the main memory before starting the program. The Bootstrap Program, as shown in the figure below, lies in the Read-Only Memory (ROM) of our computers and is responsible for reading the Operating Systems and loading them into the RAM (Random Access Memory) of our computers. After then, the operating systems can start other computer devices such as graphics cards, keyboards, and mice. 

15. What do you know about demand paging in operating systems?

Demand paging in operating systems is a strategy for loading pages (a page is the smallest unit of data for memory management in a virtual memory operating system). A page frame is the smallest contiguous unit of physical memory with a predetermined length into which the operating system maps memory pages) only when they are needed. Virtual Memory is a storage allocation method that makes it possible to address secondary memory as if it were the main memory. The addresses used by a program to refer to memory are different from the addresses used by the memory system to designate physical storage sites, and the addresses created by the program are automatically converted to machine addresses. The quantity of secondary memory available is defined by the number of main storage sites available rather than the actual number of main storage locations, and the capacity of virtual storage is restricted by the computer system's addressing scheme.

When a place on the page is addressed during execution, the page is only brought into memory. The following are the steps for getting a page into the main memory or demand paging:

  • An attempt is made by the operating system to visit the page.
  • If the page is valid, the CPU proceeds to process instructions as usual (in memory).
  • When a page is wrong, the operating system performs a page fault trap.
  • The operating system then examines the memory reference to see if it is a valid reference to a secondary memory location. The process will be cancelled if this is not the case (illegal memory access). Otherwise, the operating system will have to read the page from the main memory.
  • The operating system arranges a disc operation to read the desired page into the main memory.
  • The operation that was paused as a result of the operating system trap is then restarted or continued.

16. What do you know about a VPN (Virtual Private Network)? What are the many types of virtual private networks (VPNs)?

A virtual private network (VPN) connects users' computers to a private network across a public network, allowing them to send and receive data as if they were physically connected to the private network. Using a VPN gives you more capability, security, and control over your private network. Telecommuting professionals typically use it to acquire access to resources that aren't available on the public network. Although encryption is common, a VPN connection does not require it. A VPN is created by creating a virtual point to point connection over existing networks utilising dedicated circuits or tunnelling technology. Some of the advantages of a wide area network can be acquired by connecting to a VPN over the public Internet (WAN). From the user's perspective, the resources supplied within the private network can be accessed remotely.

The following are the various types of VPNs: 

  • Site to Site VPN: A Site to Site VPN, also known as a Router to Router VPN, joins the networks of two offices in different locations. There are two subcategories, as indicated below:
    • Intranet VPN: Intranet VPNs are used for connecting remote offices in various locations utilising one single infrastructure, that is, the servers, internet connectivity, etc., as a private WAN and the same accessibility policies (wide area network).
    • Extranet VPN: Extranet VPN uses common infrastructure to connect intranet users, suppliers, consumers, partners, and other entities via dedicated connections.
  • Access VPN: An access VPN is a sort of virtual private network that allows mobile users and telecommuters to connect to the internet from a remote location. Dial-up or ISDN (Integrated Services Digital Network) connections can be replaced with it. It's a budget-friendly alternative with a variety of connectivity possibilities.

17. In the context of operating systems, define microkernels.

One of the kernel's classes is the microkernel. Because it is a kernel, it is in charge of all system resources. In a microkernel, however, user and kernel services are implemented in separate address zones. Because user services are placed in user address space and kernel services are located in kernel address space, the kernel and operating system are both smaller. It just offers the minimal essentials in terms of process and memory management. The execution microkernel is slowed by message forwarding, which is used to establish communication between client programs/applications and services executing in user address space. Because user and kernel services are separated, the Operating System is unaffected if one fails. As a result, one of the microkernel's advantages is enhanced. It's simple to extend since new services are added to the user address space rather than the kernel address area, requiring no kernel changes. It's also portable, secure, and dependable. The architecture of a microkernel is shown below:

The following are some of Microkernel's advantages:

  • This kernel performs better because of its compact and isolated architecture.
  • The system can be expanded more easily since it can be added to the system application without disrupting the kernel.

18. What is the difference between Swapping and Paging.

The main differences between Swapping and Paging are given below:

SWAPPING PAGING
In swapping, the whole process in its entirety is moved to the secondary memory. Paging is done when some part of a process is being transferred to secondary memory.
In Swapping, the temporary transfer of a process from the main memory to secondary memory takes place. In Paging, a contiguous block of memory is made non-contiguous but of fixed size called frame or pages.
Swapping requires no memory management. Paging requires non-contiguous Memory Management.
The direction regarding the solution in it is provided in swapping. No direction regarding the solution in it is provided in Paging.

19. What is Servlet Collaboration?

The process of communicating information among the servlets of a Java web application is known as servlet collaboration. This enables data to be transmitted from one servlet to another via method invocations. Java's Servlet API (Application Programming Interface), which exposes two interfaces, is the primary method for achieving Servlet Collaboration.

  • javax.servlet.RequestDispatcher
  • javax.servlet.http.HttpServletResponse

These two interfaces contain the approaches for achieving the purpose of servlet information exchange.

20. In operating systems, define spooling.

Spooling is the temporary storage of data so that it can be used and processed by a device, software, or system. Data is supplied to and stored in memory or other volatile storage until it is required by a programme or computer for execution. SPOOL is an abbreviation for "Simultaneous Peripheral Operations Online." The spool is typically stored in physical memory, buffers, or interrupts for Input/Output devices on the computer. To process the spool in ascending order, the FIFO (first in, first out) approach is employed. Spooling is the process of gathering data from a large number of Input/Output processes and storing it in a buffer. This buffer is a memory or hard disc area that Input/Output devices can access. In a distributed context, an operating system does the following:

  • Controls data spooling for Input/Output devices with varying data access rates.
  • Maintains the spooling buffer, which acts as a data holding space while the slower device catches up.
  • The spooling procedure preserves parallel computing since a computer can perform Input/Output in parallel sequence. The computer can now read data from a tape, write data to disc, and print data to a tape printer all at the same time.

Printing is the most visible application of spooling. Before being added to the printing queue, the papers to be printed are held in the SPOOL. Several programmes can run and use the CPU during this period without having to wait for the printer to finish printing on each paper individually. Many additional features, such as defining priorities, receiving notifications when the printing process is complete, and selecting different types of paper to print on based on the user's preferences, can be added to the Spooling printing process.

Useful Interview Resources

Uber Interview Preparation

Interview Preparation Tips

The following strategies for preparing for a Uber interview are strongly advised for readers of this article:

  • To see how quickly you can solve a set of coding tasks, put yourself to the test. This will aid in the development of your reasoning structures and problem-solving abilities.
  • Share your experiences and be well prepared to show leadership, teamwork, professional and academic success, communication skills, and the ability to overcome hurdles and problems.
  • It is always beneficial to maintain a positive and welcoming attitude. Begin the conversation on a positive note by confidently introducing yourself.
  • The more prepared you are for an interview, the better your chances of landing a job. Learn everything there is to know about interviews, including the stages, rounds, and questions. Answers to frequently requested questions should be prepared ahead of time for human resource (HR) interviews. You can also learn about firm performance, organisational structure, vision, and work and life balance, among other things.
  • Examine the organization's interview experience articles. This will give you a decent idea of how the actual interview will go and what to expect.
  • Consider doing a practice interview. This will give you a sense of how the interview will be conducted. You can use the InterviewBit platform to create mock interviews. You will be paired with your peers, and both of you will be allowed to interview, which will be beneficial to you.

Uber Coding Questions

Minimum Difference Subsets!
Dynamic Programming
Solve Problem
Counting Subarrays!
Two Pointers
Solve Problem
Subarrays with distinct integers!
Two Pointers
Solve Problem
Path in Directed Graph
Graph Data Structure & Algorithms
Solve Problem
Collect Resources
Dynamic Programming
Solve Problem

Frequently Asked Questions

1. How difficult is an Uber Software Engineering interview?

It makes no difference if the Uber Software Engineering interview is difficult or simple. The truth is that the more prepared you are for the interview, the more likely you are to pass it. It is important that you familiarise yourself with the various interview stage, rounds, and questions at Uber. Programming languages, internships, products, software, and projects on which candidates have recently or previously worked are a few of the things asked in an Uber Software Engineering interview. As a result, instead of focusing on how tough or easy the interviews are, one should concentrate on how to increase one's technical and cultural skills. 

2. How should one answer the following question: Why are you interested in joining Uber?

Uber recruits and maintains top people by offering inclusive and fast-growing opportunities through a digital learning environment that is accessible from anywhere, at any time, on any device. Uber is an excellent environment for new employee to begin their career sheerly because of the immense exposure one gets over there and their fantastic work environment. Uber offers a warm, friendly setting that encourages personal and corporate development and that is why I and today's perspective programmers should be interested in joining Uber.

3. What are the most crucial subjects to cover in preparation for a Uber Interview?

Your programming abilities will be examined during the Uber Interview. Students will be quizzed on computer science fundamentals such as computer networking, database management systems, software management, operating systems, and cloud computing. Make sure you are ready for the projects you have created. Prepare the things that your CV mentions. In Uber HR interviews, the most commonly asked questions are concerning relocation, resumes, reasons for leaving a previous company (for experienced folks making a company switch), and expected income.

4. What is the proper way to respond to the following behavioural question: Why are you qualified for this job position?

When asked a question like this, one should emphasise relevant talents and qualities to make a great impression on the interviewer and convince him or her that you are the best applicant for the job. This is an example of a typical response to this question:

"There are numerous reasons why I am qualified for this position, but the most essential reason is that I am confident that I am deserving of it because I have the desire to achieve big in life to help impact the lives of millions of people. I have all of the talents that I will need to succeed in this field and I am always trying to stay up to date on new technology and upskill. My abilities and skills are therefore perfectly suited to this position's criteria."

5. How long is the Uber Software Engineering interview?

A typical Uber Software Engineering interview lasts for about forty minutes to an hour. The entire Uber Recruitment process consists of various rounds (both coding round and interview) and usually lasts for about two to three months roughly.

6. What is the average salary of a Software Engineering Fresher at Uber?

The usual salary of a Software Development Engineer Fresher at Uber is around Rs. 20,45,000 per year. The Software Development Engineer salaries at Uber usually range from around Rs. 5,22,000 to around ₹26,98,000 per year.

7. How would you respond to the following behavioural question: In five years, where do you see yourself?

The most effective way to impress the interviewer with your response to the given behavioural question is to demonstrate that you are extremely motivated to work for the company for the next five years and that you have a clear idea of how you will contribute to the company's growth during that time period. The following is an example of a response to the provided question:

"My long term aim for the next five years is to master my role and become a department leader in my team. I am intrigued by your company's individualised learning strategy, which your website discusses, and I am confident that it will enable you to gain new abilities and progress in this role. Over the next five years, I will be working on interesting new projects for the company that will prepare me for a leadership role."

8. How should you respond to the following behavioural question: What are your strengths and weaknesses?

This is, without a doubt, one of the most commonly asked topics in HR interviews. You should not appear overconfident in your response to this question. Dealing with mistakes, on the other hand, does not appear to be unreliable. Being truthful is always a good idea. The following are some of the advantages that can be addressed in the interview:

  • I am an excellent communicator.
  • I have strong leadership qualities that will benefit me in the long run.
  • I am a team player who is goal-oriented and eager to learn new things on a daily basis.
  • My capacity to handle pressure and remain calm in challenging times distinguishes me from other candidates.

Let us now have a look at some of the flaws that can be brought out during the interview:

  • When I'm new to technology or situation, I feel a lot of self-doubts.
  • I am a self-critical person.
  • I am afraid of being on stage (fear of speaking in front of a large crowd)

It is critical to admit mistakes, but it is also critical to explain how you worked to rectify them. This will give the sense to the interviewer that you are always looking for ways to improve.

9. What is the eligibility criteria for Software Engineers at Uber

The majority of other companies' new qualification standards are identical to Uber's. Candidates must check the following eligibility criteria (both graduation and general criteria) before applying for the Uber Recruitment process:

Graduation Criteria: The following are the graduation requirements for the Uber Recruitment Process:-

Criteria of Graduation Details
Branch of Study or Department of Study
  • Candidates must be having a Bachelor's of Technology or B.Tech. (or equivalent degrees like Bachelor's of Engineering or B.E.) in computer science, electrical engineering, mechanical engineering, electronics engineering, or mathematical sciences at the time of application. They can also hold a dual degree from two different fields that are linked. 
  • M.S. (Master of Science) in Computer Science or Information Technology or any other related fields.
Mode of Study Full-Time courses recognised by the Central or State governments of India. (Not the part-time or correspondence courses available.)
Minimum Percentage criteria with which Graduation needs to be done. Sixty Percent (60%).
Experience It is necessary to have extensive software engineering knowledge from previous projects or internships. If the candidate has relevant work experience or has done competitive coding, that is a great plus. It's a boost if you have been published in magazines or have active initiatives.
Backlogs No Backlogs are active during the Uber Recruitment Process.

Academic Criteria: The following are the academic requirements for the Uber Selection Process:-

Academic Criteria Information
Minimum Percentage required in 10th Standard and 12th Standard Examinations. 60%

Required Skills: The skills which are required for the Uber Recruitment Process are as follows:-

  • Technical Skills: Expertise in Computer Science Fundamentals, Data Structure and Algorithms and command in one Programming Language at least like Python, Java, C ++, etc. 
  • Other General Skills: Some of the other skills which an ideal candidate should possess are as follows:
    • Candidates must be confident in their ability to create infrastructure and tools.
    • They must want to work as part of a team and achieve daily goals.
    • Candidates must possess a strong sense of personal responsibility.
    • They must be able to communicate effectively in a corporate setting.
    • The candidate should know about the Software Development Cycle and be comfortable implementing it in his or her daily job.
    • Candidates must be able to build programs or software that are long-lasting, legible, and reusable.
    • They should be able to learn new approaches and languages with ease.
Get Placed at Top Product Companies with Scaler Know More 
Get Placed at Top Product Companies with Scaler Know More 
Get Placed at Top Product Companies with Scaler
Sat transparent 640a34d454880bf68e3bfdf33f2389f2214043f59ad18b4c7f7b114e834fb257.svg

Point markers b3add1cc88e4996b2df6e0aedb9f0d1b65fa73c51b7ada8fbee3895a2aa11802.svg Personalised feedback report with solutions
Point markers b3add1cc88e4996b2df6e0aedb9f0d1b65fa73c51b7ada8fbee3895a2aa11802.svg Real life Interview Questions
Point markers b3add1cc88e4996b2df6e0aedb9f0d1b65fa73c51b7ada8fbee3895a2aa11802.svg Identify exact topics to improve

Your feedback is important to help us improve.
Free Mock Assessment
Help us know you better for the best experience
Current Employer *
Enter company name
College you graduated from *
Enter university name
Phone Number *
OTP will be sent to this number for verification
+91
+91
Change Number
Edit
Resend OTP
By Continuing I agree to be contacted by Scaler in the future.
Already have an account? Log in