Microsoft Interview Question for Program Managers


Team: Windows Azure
Country: United States
Interview Type: In-Person




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

if i am not wrong, Pre-order travel does the job.

Since pre-order we go to Leftmost Node from left subtree to rightmost node from right sub tree. DFS.

- Nitin September 26, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Yes you are right, because DFS does not have any specific procedure to select children, if choose randomly, so Preorder is also one of the option.

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

#include<stdio.h>
#define m 8
void dfs(int i,int (*a)[8],int *v,int n)
{
int j=0;
v[i]=1;
printf(" %d",i+1);
while(j<n)
{
if(a[i][j]==1&&v[j]==0)
dfs(j,a,v,n);
j++;
}
return;
}
int main()
{
int i,n,j,a[m][m],v[m]={0};
printf("how many vertex you got for graph");
scanf("%d",&n);
printf("ok now insert your value but remember insert '0' if no edge exist");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
scanf("%d",&a[i][j]);
}
dfs(0,a,v,n);
}

- Dhuriya September 26, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

what do you mean by code structure ?

- Anonymous October 07, 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