Ola Cabs
10+ MARS E-SERVICES Interview Questions and Answers
Q1. Problem: Permutations of a String
Given a string STR
consisting of lowercase English letters, your task is to return all permutations of the given string in lexicographically increasing order.
Explanation:
A st...read more
Q2. Find the Kth Row of Pascal's Triangle Problem Statement
Given a non-negative integer 'K', determine the Kth row of Pascal’s Triangle.
Example:
Input:
K = 2
Output:
1 1
Input:
K = 4
Output:
1 4 6 4 1
Constraints...read more
Q3. Minimum Number Of Taps To Water Garden Problem Statement
You are required to determine the minimum number of taps that need to be opened to water an entire one-dimensional garden defined along the x-axis, which...read more
Q4. Missing Numbers Problem Statement
You are provided with an array called ARR
, consisting of distinct positive integers. Your task is to identify all the numbers that fall within the range of the smallest and lar...read more
Q5. Count Leaf Nodes in a Binary Tree
Given a binary tree, your task is to count and return the number of leaf nodes present in it.
A binary tree is a data structure where each node has at most two children, referr...read more
Q6. LRU Cache Design Question
Design a data structure for a Least Recently Used (LRU) cache that supports the following operations:
1. get(key)
- Return the value of the key if it exists in the cache; otherwise, re...read more
Q7. Diagonal Traversal of a Binary Tree Problem Statement
Given a binary tree, your task is to determine the diagonal traversal of the tree.
Example:
Input:
1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1
Output:
1 3 6 2 5 4...read more
Q8. Number of Islands Problem Statement
You are provided with a 2-dimensional matrix having N
rows and M
columns, containing only 1s (land) and 0s (water). Your goal is to determine the number of islands in this ma...read more
Q11. What is Closure
Closure is a function that captures the environment in which it was created, allowing it to access variables from that environment even after the function has finished executing.
Closure allows a function to access variables from its outer scope even after the function has finished executing.
It is created when a function is defined within another function and the inner function references variables from the outer function.
Closure helps in maintaining state in functional progra...read more
Interview Process at MARS E-SERVICES
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month