Microsoft interview question

Print a zigzag graph where each level will be inverted