# Ola Cabs Interview Questions

Ola Cabs is an Indian multinational ridesharing company, headquartered in Bangalore. It also operates in other business verticals including financial services and cloud kitchens.

It has got a 3.2* rating on Glassdoor and is considered one of the best product-based companies. It is highly regarded for its work-life balance.

They provide good training as well which will be beneficial in future too. You can practice the below questions collected from Ola Cabs Interview Experience for the interview. We have collected past frequently asked questions from Ola Cabs Interview Experience for your reference.

## Ola Cabs Array Questions

Question 1. Maximum difference between first and last indexes of an element in array Suppose, you have an array of integers. The problem “Maximum difference between first and last indexes of an element in array” asks to find out the difference between the first and last index of each number present in an array such that the difference is being maximum of all. Example ...

Question 2. Print modified array after multiple array range increment operations The problem “Print modified array after multiple array range increment operations” states that you are given an integer array and ‘q’ numbers of queries are given. One integer value “d” is also given. Each query contains two integers, starting value and an ending value. The problem statement asks to find ...

Question 3. Minimum number of distinct elements after removing m items Problem Statement The problem “Minimum number of distinct elements after removing m items” states that you have an array and an integer m. Each element of the array indicates an item id’s. The problem statement asks to remove m elements in such a way that there should be a minimum ...

Question 4. Largest Sum Contiguous Subarray Problem Statement You are given an array of integers. The problem statement asks to find out the largest sum contiguous subarray. This means nothing but to find a subarray (continuous elements) which has the largest sum among all other subarrays in the given array. Example arr[] = {1, -3, 4, ...

Question 5. Count Pairs Whose Products Exist in Array In count pairs whose products exist in array problem we have given an array, count all the distinct pairs whose product value is present in the array. Example Input A[]={2, 5, 6, 3, 15} Output Number of distinct pairs whose product exists in the array is: 2 Pairs are: (2, ...

Question 6. Sort 0s 1s and 2s in an Array Problem Statement Given an array containing N elements where elements of the array are 0,1 or 2. Sort or Segregate 0s 1s and 2s in an array. Arrange all zeros in the first half, all ones in the second half and all twos in the third half. Example Input 22 ...

Question 7. Maximum difference between two elements such as larger element comes after smaller Problem Statement We have given an array of n integers in which we have to find the maximum difference between two elements such as larger element comes after smaller. Example Input 4  7  2  18  3  6  8  11  21 Output 19 Approach 1 for Maximum difference between two elements  ...

## Ola Cabs String Questions

Question 8. Maximum weight transformation of a given string Problem Statement The maximum weight transformation of a given string problem states that given a string consisting only of two characters ‘A’ and ‘B’. We have an operation where we can transform string to another string by toggling any character. Thus many transformations are possible. Out of all the possible ...

Question 9. String comparison containing wildcards In String comparison containing wildcards problem, we have given two strings second string contains small alphabets and the first contains small alphabets and some wildcard patterns.  Wildcard patterns are: ?: we can replace this wildcard with any small alphabet. *: we can replace this wildcard with any string. An empty ...

## Ola Cabs Tree Questions

Question 10. Minimum number of distinct elements after removing m items Problem Statement The problem “Minimum number of distinct elements after removing m items” states that you have an array and an integer m. Each element of the array indicates an item id’s. The problem statement asks to remove m elements in such a way that there should be a minimum ...

## Ola Cabs Other Questions

Question 11. Compute nCr % p Problem Statement The problem “Compute nCr % p” states that you are required to find binomial coefficient modulo p. So you first must know about the binomial coefficient. We have already discussed that in a previous post. You can check that here. Example n = 5, r = 2, p ...

Question 12. Word Wrap Problem Problem Statement The word wrap problem states that given a sequence of words as input, we need to find the number of words that can be fitted in a single line at a time. So, for doing this we put breaks in the given sequence such that the printed document ...

Question 13. A Space Optimized DP solution for 0-1 Knapsack Problem Problem Statement We are given a knapsack which can hold some weight, we need to pick some of the items out of given items with some value. The items should be picked such that the value of the knapsack ( total value of picked up items ) should be maximized. ...

Translate »