Flipkart Interview Question for Software Engineer / Developers






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

i think the Question is .
if situation is like .
110000
111000
100000
100000
111110

then Answer would be the last row and No of 1's are 5 ..

Solution :
Start from the first row .. go till we encounter any zero.
Then step down by one if this new value of second row and same column is also Zero then keep stepping down without increasing Column No. else go in the same Row till find any zero.
You would be with the Row No and No'f of Max 1's at the end.
Please correct if m wrong

- mac June 26, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I am unable to understand the question
Can you please provide another example with details

- DashDash June 27, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Good solution

- Thiyanesh June 03, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

perfect soln

- sharad June 27, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

good work

- Anonymous June 27, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

good thinking mac

- Anonymous June 27, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

@mac
You are absolutely right.
they want the same soln.

Only modification is. u can use binary search. i.e check mid one if its 0 go left else right.

complexity with ur soln is 0(n+n) . and they want exactly the same

- varun June 28, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

it cannot be done with binary search.. moreover mac's solution can be made to work in O(n)

- Anonymous July 31, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Right solutin......
Thanks..

- Neha September 02, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Very good solution mac

- Vinod April 29, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

phaad diya mac

- gaurav September 24, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

#include<stdio.h>
int main()
{
    int arr[7][7]={
                   1,1,0,0,0,0,0,
                   1,1,1,0,0,0,0,
                   1,0,0,0,0,0,0,
                   1,0,0,0,0,0,0,
                   1,1,1,1,1,0,0,
                   1,1,1,1,1,1,1,
                   1,0,0,0,0,0,0
                  };
    int i=0,j=0,flag=0;
              while(i<7)
              {
                  while(arr[i][j]==1)
                  {
                      j++;
                  }
                  printf("j= %d\n",j);
                  i++;
              }
              i--;
              j--;
              printf("i=%d and j=%d",i,j);
              return 0;
}

- neelabh October 23, 2013 | 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