I wrote all 3 books of the Mistborn trilogy before the first one was published. I did take time off after The Well of Ascension to write Alcatraz Versus the Evil Librarians. I often write my smaller books and short stories as a way to refresh myself so that I don’t get tired of a larger project I’m working on.
Because I had finished the trilogy before releasing The Final Empire, I was able to add foreshadowing too all three books, and fix changes to characters and events that might have needed retconning otherwise. It was a nice luxury to have.