Microsoft Interview Question for Software Engineer / Developers


Team: Bing
Country: India
Interview Type: Phone Interview




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

Start traversing the picture
----> If found an unfound land pixel
--------> DFS traverse all connected land pixels mark all of them found

Number of islands = Number of DFS traversals started for land pixels

- Old Monk December 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

Any closed shape of sufficient area containing color other than blue as majority can be considered an island.

This is just a basic idea but can be helpful if a programming approach is to be used.

- akashjain279 November 30, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Other than the blue color, use dfs to find disconnected graphs. Each disconnected graph is counted as an island.

- Nguyen November 30, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Perform image segmentation to get the number of islands.

- BoredCoder December 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

separate the picture into n by m grids, you shall know the resolution of the picture so make sure each tile is at least 4 times smaller than an minimum island. then count all connected tiles other than blue as one, sum them up to get the number of islands.

- gridguy December 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

We can do this by using the Connected Components algorithm that uses the Union-Find data structure. To account for different shades of same color we can define a function that will return true if difference between color attributes of neighbouring pixels are within some configurable threshold.

- vstudio December 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Perform a Fourier transform using polar coordinates and find the spikes of concentric radii that differ in phase using the color as a complex magnitude. They will be evident by the difference in continuity of the transform.

- Alex December 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Connected components Algorithm or DFS/BFS can be applied once you convert the given satellite picture into a graph/tree which is practically not a good practice.

This is a Machine Learning question. You need sample data (if supervised learning is to be implemented).

- Mahendra December 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

You don't need machine learning for this. This is a popular image processing problem called blob counting.

Basic idea is to:
Convert to gray-scale, low-pass filter to get rid of any noise, count blobs.

Search for "image processing blob counting" if you want something more concrete.

- Jay December 02, 2012 | 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