Work in HR or Recruiting?
Microsoft
www.microsoft.com Redmond, WA 5000+ Employees
Work in HR? Complete Your Profile

142 interview experiences Back to all Microsoft Interview Questions & Reviews

Interview Question for Software Development Engineer Intern at Microsoft:
Jan 04, 2013

1 of 1 people found this helpful

Print a binary tree level by level in zigzag order


Add Tags [?]

See more for this Microsoft Software Development Engineer Intern Interview

Helpful Question?  
Yes | No
Inappropriate?

Answers & Comments (3)

Jan 07, 2013

by Alexey:

You should use two stacks: for the current level and for the next one.
Helpful Answer?  
Yes | No
Inappropriate?

0 of 1 people found this helpful

Jan 27, 2013

by Nofel:

Use a queue.
1.Push root on queue.
2. Begin Loop Repeat while node is not equal to NULL:
            a. Pop
            b. Print value
            c. Push node's Right Child
            d. Push node's Left Child
3. End
Helpful Answer?  
Yes | No
Inappropriate?

1 of 1 people found this helpful

Jan 27, 2013

by Nofel:

The answer given by me above is wrong because I was not clear about the zig zag ordering I applied it wrong !
Helpful Answer?  
Yes | No
Inappropriate?

To comment on this question, Sign In with Facebook or Sign Up

Microsoft – Why Work for Us?

Amazing things happen here! From gamers to governments, moms to mega-corporations, Microsoft helps customers all over the globe to realize their potential. Many people think Microsoft = software. Yes, we do… Full Overview

Provided by employer [?]

Tags are like keywords, helping to categorise interview questions that have something in common.