InMobi Interview Questions
- 0of 0 votes
AnswersA special number is defined as a number where, in binary notation,
- poorna.chandra.akp December 05, 2017 in India
a. has only set bits (OR)
b. all set bits are followed by unset bits (OR)
c. the sequence formed by count of the number of set bits separated by any number of unset bits is a contiguous subsequence of the sequence of natural numbers.
2, 3, 11271 and 15667135 are special numbers because their binary represenation is 10, 11, 10110000000111 and 111011110000111110111111 respectively.
2 is a special number because of condition (b).
3 is a special number because of condition (a).
11271 is a special number because its binary representation is 10110000000111 because of condition (c). The sequence of the count of number of set bits separated by a unset bits is 1, 2 and 3. This is clearly a continguous subsequence of the natural numbers.
Similarly, 15667135 is a special number. (The sequence is 3,4, 5 and 6.)
So, given two integers n and m where n <= m, find out the number of special numbers between n and m inclusive.
Input Format:
The first line of input contains an integer T where T is the number of test cases. Then T lines follow containing two space separated integers n and m where n <= m.
Output Format:
For each test case, output, in different lines, a single integer P where P is the number of special numbers between the range specified.
Constraints:
1 <= T <= 1000
1 <= n <= 10^6
1 <= m <= 10^6
n <= m
Sample Input:
4
2 10
11 15
20 30
2 100
Sample Output:
6
4
5
43| Report Duplicate | Flag | PURGE
InMobi Senior Software Development Engineer - 0of 0 votes
AnswersGiven a number, return the count of numbers having non-repeating digits till that number starting from 1?
- crowdx December 04, 2016 in India| Report Duplicate | Flag | PURGE
InMobi Algorithm - 0of 0 votes
Answermillions of data are there, they are chunked across different computer node to reduce the load on RAM, CPU etc.
- Nueman September 07, 2016 in India
There is one computer node where data are store after sorting them in different nodes...i.e. sorting is done in different nodes and only the sorted merge happens in the integration node...
Write test cases including performance, smoke, sanity, regression, boundary, usability, stress etc etc| Report Duplicate | Flag | PURGE
InMobi Testing / Quality Assurance Testing - 0of 0 votes
AnswersYou have a farm of 400m * 600m where coordinates of the field are from (0, 0) to (399, 599). Some part of the farm is barren. All the barren land is in form of rectangles. Due to these rectangles of barren land, the remaining area of fertile land is present in form of holes in the farm. Each hole is a maximal area of land that is not covered by any of the rectangles of barren land.
- contactsantoshb July 22, 2015 in India
Input
You are given a set of rectangles that contain the barren land. Each String in rectangles consist of four integers separated by single spaces, with no additional spaces in the string. The first two integers are the coordinates of the bottom left corner in the given rectangle, and the last two integers are the coordinates of its top right corner.
Output
Output all the holes’s area in square meters, sorted from smallest area to greatest, separate by space.
Sample Input/ Output
Sample Input Sample Output
{“0 292 399 307”} 116800 116800
{“48 192 351 207”, “48 392 351 407”, “120 52 135 547”, “260 52 275 547”}
22816 192608
Deliverables – the code below or similar structure
import java.io.*;
public class Solution { public static void main(String args[] ) throws Exception { /* Enter your code here. ead input from STDIN. Print output to STDOUT */ }}| Report Duplicate | Flag | PURGE
InMobi Analyst Algorithm - 0of 0 votes
AnswerI was asked to design a trading system, where there will be no of buyers and sellers will transact. The system need to have low latency, the buyers will quote no of shares, company name, price they want to buy, the sellers will quote the price they want to sell for given company, and no of shares. The system has to match the buyers and sellers and transact. This is more of design question.
- softwaregeek June 09, 2014 in India
I was thinking in terms of a hashmap kind a structure where the key will hash to the given company, and then there will be buckets for no of shares for buyers, with different buckets for prices, the idea is to look up in memory sellers, if a match is found then make the transaction. If the in memory data exceeds a limit implement a caching, and push the older data to the persistent store. The guy was'nt convinced this was a good design. Can someone suggest how is real time trading systems implemented, do they go for low latency queues.| Report Duplicate | Flag | PURGE
InMobi Developer Program Engineer Computer Architecture & Low Level - 0of 0 votes
AnswersFoo was not amongst the most brilliant students of his class. So, he has some pending exams to clear. As the exams are approaching, this time he vowed to pass in all of them. This will only happen if he is not under stress. Foo's stress can be calculated using a simple function called Foo_function which depends upon the time for which Foo studies continuously .
- avinash.it09 June 01, 2014 in India
Foo_funtion is defined as follows:
F(t)=A(t^3)+B(t^2)+C*(t)+D, F(t)<=10^18
where A,B,C,D belong to the set of prime numbers. t is the time in minutes for which foo studies continuously.
As foo is not very good at solving cubic equations, he seeks your help to find out the maximum number of minutes for which he can study continuously without taking stress. Help him find t such that F(t+1) > K, and F(t) <= K, where K is the maximum stress Foo can bear.
Input:
The first line of the input contains a single integer T denoting the number of test cases. each test case consists of a single line containing 5 space seperated positive numbers a, b, c, d, K.
Output:
for each test case, output a single integer t denoting the maximum time for which foo can study continuously without taking stress.
Constraints:
1 <= T <= 10^4
A, B, C, D belong to a set of prime numbers such that F(t) would never exceed 10^18
t >= 0
1 <= K <= 10^18
Sample Input (Plaintext Link)
2
2 2 2 2 10
2 3 5 7 1000
Sample Output (Plaintext Link)
1
7
Explanation
In the 1st test case for t = 2 foo will be under stress because F(2)=30 > K, therefore he can study for a maximum time of 1 minute without having stress.
In the 2nd test case for t = 8 foo will be under stess because F(8)=1263 > K, therefore he can study for a maximum time of 7 minutes continuously without having stress.
Time Limit 5 sec(s) (Time limit is for each input file.)
Memory Limit256 MB
Source Limit1024 KB| Report Duplicate | Flag | PURGE
InMobi SDE1 Algorithm - -1of 1 vote
AnswersGiven a integer N, print the decimal form of 1/2n.
- avinash.it09 May 31, 2014 in India
Example:
N=1, print 0.5
N=2, print 0.25
Adding leading/unsignificant zeroes will lead to wrong answer. Example, printing 0.50 instead of 0.5 in above case will lead to wrong answer.
Input and Output:
First line contains T, the number of testcases. Each testcase consists of N in one line.
Print required answer in one line for each testcase.
Constraints:
1 ≤ T ≤ 100
1 ≤ N ≤ 200
Sample Input (Plaintext Link)
2
2
1
Sample Output (Plaintext Link)
0.25
0.5
Explanation
You need to print output in decimal form only. There is no limit on number of decimal digits in output.
So correct output of 100 will be "0.0000000000000000000000000000007888609052210118054117285652827862296732064351090230047702789306640625"
Time Limit1 sec(s) (Time limit is for each input file.)
Memory Limit256 MB
Source Limit1024 KB| Report Duplicate | Flag | PURGE
InMobi SDE1 - 0of 0 votes
AnswersYou have a rectangular chocolate bar that consists of width x height square tiles. You can split it into two rectangular pieces by creating a single vertical or horizontal break along tile edges. For example, a 2x2 chocolate bar can be divided into two 2x1 pieces, but it cannot be divided into two pieces, where one of them is 1x1. You can repeat the split operation as many times as you want, each time splitting a single rectangular piece into two rectangular pieces.
- poorna.chandra.akp May 19, 2014 in India
Your goal is to create at least one piece which consists of exactly nTiles tiles. Return the minimal number of split operations necessary to reach this goal. If it is impossible, return -1.
Complete the function getMinSplit, which takes in 3 integers as parameters. The first parameter is width of the chocolate, the second is height of the chocolate and third is nTiles, the number of tiles required.
Constraints
- width will be between 1 and 109, inclusive.
- hight will be between 1 and 109, inclusive.
- nTiles will be between 1 and 109, inclusive.
Example 0
5
4
12
Returns: 1
You can split the chocolate bar into two rectangular pieces 3 x 4 and 2 x 4 by creating a single vertical break. Only one break is necessary.
Example 1
12
10
120
Returns: 0
The chocolate bar consists of exactly 120 tiles.
Example 2
2
2
1
Returns: 2
Example 3
17
19
111
Returns: -1
Example 4
226800000
10000000
938071715
Returns: 2| Report Duplicate | Flag | PURGE
InMobi SDE-2 - 1of 1 vote
AnswersHuman gene consisting of four nucleotides, which are simply denoted by four letters, A, C, G, and T.
- poorna.chandra.akp May 19, 2014 in India
Your job is to make a program that compares two genes and determines their similarity as explained below.
Given two genes AGTGATG and GTTAG, how similar are they? One of the methods to measure the similarity of two genes is called alignment. In an alignment, spaces are inserted, if necessary, in appropriate positions of the genes to make them equally long and score the resulting genes according to a scoring matrix.
For example, one space is inserted into AGTGATG to result in AGTGAT-G, and three spaces are inserted into GTTAG to result in -GT--TAG. A space is denoted by a minus sign (-). The two genes are now of equal length. These two strings are aligned:
AGTGAT-G
-GT--TAG
In this alignment, there are four matches, namely, G in the second position, T in the third, T in the sixth, and G in the eighth. Each pair of aligned characters is assigned a score according to the following scoring matrix.
* denotes that a space-space match is not allowed.
The score of the alignment above is (-3)+5+5+(-2)+(-3)+5+(-3)+5=9.
Of course, many other alignments are possible. One is shown below (a different number of spaces are inserted into different positions):
AGTGATG
-GTTA-G
This alignment gives a score of (-3)+5+5+(-2)+5+(-1) +5=14. So, this one is better than the previous one. As a matter of fact, this one is optimal since no other alignment can have a higher score. So, it is said that the similarity of the two genes is 14.
You are expected to complete the function getDNAAlignment, which takes in two strings as argument.
Constraints
Length of both strings will not exceed 1000.
Both string will be non-empty strings.
strings will only consists of character from set {'A', 'C', 'G', 'T'}
Sample Input 00
AGTGATG
GTTAG
Returns: 14
Sample Input 01
AGCTATT
AGCTTTAAA
Returns: 21| Report Duplicate | Flag | PURGE
InMobi SDE-2 - 0of 0 votes
AnswerYou are a coin collector in a country, where the silver coin denominations runs from 1 to 1000000. You have N coins with you with various denominations.
- poorna.chandra.akp May 19, 2014 in India
Apart from the silver coins, the country also issues gold coins which can be used as any value. With the given silver and gold coins, find out the maximum continous denomination streak you can achieve.
For example, if you have 4 silver coins of value 2, 3, 5 and 9 and 1 gold coin. You can have a maximum streak of 4 coins by using the gold coin as value 4.
Input format.
The first line contains 2 integers, S and G. S is the number of silver coins you have and G is the number of gold coins you have. S lines follow, each line is the value of the corresponding silver coin
Output format:
One integer, representing the maximum streak you can have using the coint.
Sample Input 1
4 1
2
3
5
7
Sample Output 1
4| Report Duplicate | Flag | PURGE
InMobi SDE-2 - 1of 1 vote
AnswersThere are few sets with some numbers. And you are given an array of numbers. Find combination of sets with minimum number of sets, union of which have all these numbers.
- aks August 22, 2013 in India
Example:
input sets:
A => [1,2,3]
B => [2,5,8]
C => [1,4,5]
D => [3,5,8]
Array to find:
{3,4,8}
Answer:
C + D| Report Duplicate | Flag | PURGE
InMobi Software Engineer / Developer Algorithm - 0of 0 votes
AnswersSuppose you have an array of +ve numbers, -ve numbers and zeroes. Devise an algorithm to find the maximum contiguous subsequence product.
- Murali Mohan June 12, 2013 in India
For 7 -3 -1 2 -40 0 3 6, the max subsequence product = -1 * 2 * -40 = 80
For -3 7 2 0 -5 7 -2 -2 2, the maximum subsequence product = -5 * 7 * -2 = 70| Report Duplicate | Flag | PURGE
InMobi Algorithm - 0of 0 votes
Answersgiven a set of coordinates (a,b), (d,e)... etc.
- sonesh November 22, 2012 in United States
write a program to find Slope and Intercept of a line such that max points from those specified pass through the line.| Report Duplicate | Flag | PURGE
InMobi Software Engineer / Developer Algorithm - 0of 0 votes
Answersgiven an array of positive integers and that you are allowed to change the sign of any of the integers whenever you require.
write a program to calculate the minimum sum of this array.
the sum should be >=0.
for example :Array = {1,2,4,5} then sum = 0 as we change sign of 1 and 5{-1,2,4,-5
}
Another Example :Array = {1,2,4,5,6,17,20}, sum = 1 with {1,2,-4,5,-6,-17,20
}
- sonesh November 22, 2012 in United States| Report Duplicate | Flag | PURGE
InMobi Software Engineer / Developer Algorithm - 0of 0 votes
AnswersDesign the Class diagram for vending machine for Tea & Coffee. This machine can generate the diff type of tea like Cardemom, Elichi, Ginger. Same way 3 type of coffee. The thing is when you make the tea or coffee user can add n number of flavors like sugar, honey or etc.
- Aashish July 24, 2012 in India| Report Duplicate | Flag | PURGE
InMobi Software Engineer / Developer Application / UI Design - 0of 0 votes
AnswersYou have an API to predict stock values of a particular share,
- get.santhoshkrishna May 19, 2012 in India
The API is
StockPrediction predict(int stockid);
where
class StockPrediction{
Date time:
float value;
}
using this API develop another API which will suggest the best selling time and buying time of a share (you have to call the predict API N number of times and from the StockPredictions provide the best buy time and sell time for the stock)
Your API can be BestTiming getBestTiming(int stockid);
where
class BestTiming{
StockPrediction bestselltime:
StockPrediction bestbuytime:
}
eg
values --> 10 12 7 8 24 35 1 9
time -----> 9am 9.30 9.45 10am 11am 12am 3am 4am
out put : buy the stock at 7 rs at 9.45 and sell it for 35 rupees at 12am
(hint: go for the best solution which uses only three variable to get this result)| Report Duplicate | Flag | PURGE
InMobi Algorithm - 0of 0 votes
AnswersInteger Array A of size N. Your job is to fill integer array B of size N where B[i] = products of all elements in A except the one at index i.
- get.santhoshkrishna May 19, 2012 in India
Simple solution prod = product of all elements in A
B[i] = prod/A[i]
Now to make it an interesting problem, can you solve it without using division operation?| Report Duplicate | Flag | PURGE
InMobi Algorithm - 0of 0 votes
AnswersWrite a java program to do the breadth first search of a graph.
- get.santhoshkrishna May 19, 2012 in United States| Report Duplicate | Flag | PURGE
InMobi Java Trees and Graphs - 0of 0 votes
Answersunsorted integer array with values 1 to N-1 has one duplicate element in it.
- get.santhoshkrishna May 19, 2012 in India
(N is the size of the array. max value is N-1 because of the duplicate element.)
Best way to find the duplicate element? If possible O(log n)| Report Duplicate | Flag | PURGE
InMobi Algorithm - 0of 0 votes
AnswersYou are given an unsorted array with both positive and negative elements. You have to find the smallest positive number missing from the array in O(n) time using constant extra space.
- ashu February 19, 2012 in India
Eg:
Input = {2, 3, 7, 6, 8, -1, -10, 15}
Output = 1
Input = { 2, 3, -7, 6, 8, 1, -10, 15 }
Output = 4| Report Duplicate | Flag | PURGE
InMobi Algorithm - 0of 0 votes
AnswersYou are given n variable length sets with each set like set1: [s1.....e1], set2:[s2.....e2] with the condition that the sets overlap (i.e. if you represent them on number line, they intersect). Now you have to remove the minimum number of sets from here so that the remaining sets are disjoint.
- ashu February 19, 2012 in India
For example you have set S1, S2, S3 with S1 and S3 disjoint and S2 overlapping both S1 and S3 then we remove S2 to get the answer.| Report Duplicate | Flag | PURGE
InMobi Algorithm - 0of 0 votes
AnswersRound 4: [HR rounds]
- dutta.dipankar08 February 18, 2012 in India for InMobi
Ans 1: Explaied about InMobi and why should i Join It?
Ans 2. Benefit details.
Q1. As already you have been Offered from ABC , would u accept our offer and why?
Q2. Current CTC ? ABC-Offered CTC ? Expected CTC ?| Report Duplicate | Flag | PURGE
InMobi Software Engineer / Developer - 0of 0 votes
AnswersRound 3 | [With manager]... Discussion regarding Product , Issues etc etc...
- dutta.dipankar08 February 18, 2012 in India for InMobi
Q1. As you know there are a lot of s/w which block adds. How to crack these ADD-Blocker S/w ?
[hints-: Url mapping]
Q2. How will you efficiently Look up Adds for a Particular mobile user. Do it very space and Time bounded manner. Find DS and Design algo for that.
[ Hints -Some concept of Learning technique, Expert System, and Data mining ]| Report Duplicate | Flag | PURGE
InMobi Software Engineer / Developer - 0of 0 votes
AnswersRound 2 | Q2. Explain your Internnship Project. He Asked for the System Model and Mathematical Proof .{ as my project does this } Some Cross Question about the Architecture of the System.
- dutta.dipankar08 February 18, 2012 in India for InMobi| Report Duplicate | Flag | PURGE
InMobi Software Engineer / Developer - 0of 0 votes
AnswersRound 2 | Q1. Design an authentication and Authorization system for a Web-service ? How will you deals with Certificate and Auth-Key Management ?
- dutta.dipankar08 February 18, 2012 in India for InMobi| Report Duplicate | Flag | PURGE
InMobi Software Engineer / Developer - 0of 0 votes
AnswersRound 1| Q3: Find out n-th ugly number ? an ugly number is define as 2^i * 3^j * 5^k.
- dutta.dipankar08 February 18, 2012 in India for InMobi
[Hints -DP]| Report Duplicate | Flag | PURGE
InMobi Software Engineer / Developer - 0of 0 votes
AnswersRound 1 | Question 2: Suppose you are givean an expression E= x1 y1 x2 y2....yn-1 xn.
- dutta.dipankar08 February 18, 2012 in India for InMobi
Where Xi belong to natural number and Yi belongs to { +,*}
you need to parenthesize such that it maximize the value of E ?
Let's change Yi to { +,-,*,/}, then how to maximize E?
Now add % operator in that set..then how to maximize E?
[Hints --Use DP]| Report Duplicate | Flag | PURGE
InMobi Software Engineer / Developer - 0of 0 votes
AnswersRound 1 | Q1. Suppose We want to design a Car-parking system. where car can be parked in FCFS basis, But there are some Spacial person ,say P1,P2,p3..having a priority of x1<x2<x3. can be access car according to their Priority.
- dutta.dipankar08 February 18, 2012 in India for InMobi
Give the Data-structure to implement this. Derive Algo and Find Complexity.
[Hints- Heap +Queue OR Multilevel Feedback Priority Queue OR Multiple Heap Structure ]
How to ensure that starvation will not occurs ? How will you integrate with previous Data Structure ?
[Hints -Ageing Technique OR use Time Stamp ]| Report Duplicate | Flag | PURGE
InMobi Software Engineer / Developer - 0of 0 votes
AnswersWritten Test | Q2. A cache contains a list of String of length atmost L.suppose cache contain n String Given a String X (of length g) as input, Find out whether any anagram of X is in cache efficiently? Find out Time Complexity. [Hints - Tries /hash/ bit-map]
- dutta.dipankar08 February 18, 2012 in India for InMobi| Report Duplicate | Flag | PURGE
InMobi Software Engineer / Developer - 0of 0 votes
AnswersWritten test | Q1. Find out Inorder traversal of a Binary Tree without Recursion [hints -use Stack]
- dutta.dipankar08 February 18, 2012 in India for InMobi| Report Duplicate | Flag | PURGE
InMobi Software Engineer / Developer