InMobi Interview Question for SDE-2s


Country: India




Comment hidden because of low score. Click to expand.
0
of 0 vote

am I missing something in this question ?
all you need to find is , if given bar nTiles can be divided by width. if it can be and remainder is less than width , then one break is required.
Otherwise, find two factors , if two integer factors are possible then 2 break are required.

- vikas June 02, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I have solved with code and alog : Please check gohired dot in/2014/07/rectangular-chocolate-bar-create-at dot html

- Dhaval Dave July 10, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <cstdlib>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
while(true)
{


long long x,y,n;
cin>>x>>y>>n;
if(x*y<n)
{
cout<<"-1"<<endl;
}
else if(x*y==n)
{
cout<<"0"<<endl;
}
else if((n%x==0 && (n/x)<y) || (n%y==0 && (n/y)<x))
{
cout<<"1"<<endl;
}
else
{
bool f=false;
for(int i=1;i<=sqrt(n);i++)
{
if(n%i==0)
{
int a=i;
int b=n/i;
if((a<=x && b<=y) || (a<=y && b<=x))
{
f=true;
cout<<"2"<<endl;
break;
}
}
if(f==true)
{
break;
}
}
if(f==false)
{
cout<<"-1"<<endl;
}
}
}

return 0;
}

- Dkp July 14, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

int getMinSplit(int height, int width, int nTiles) {
	if(nTiles>height*width) return -1;
	else if(nTiles==height || nTiles==width) return 1;
	else if(nTiles==height*width) return 0;
	else return 2;
}

- Satyam Dhar July 17, 2014 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More