Um.... all of the above?
The short answer to your question is this: I knew the question of the story, that is, the central problem that drives the story. The story ain't over until that problem is resolved. So yeah, I do know the end before I start.
I would never ever ever start posting episodes for a story when I didn't know that final central question, because if I don't know what is to be resolved, I don't know if I'll finish the story.
I don't always know HOW it will happen, though. I just wrote a post the other day on my blog about my usual method for planning a novel. (It doesn't cover every aspect of writing, just my chaotic planning process.) http://daringnovelist.blogspot.com/2012/10/wednesday-update-organizing-novel.html
But, this story was kinda different.
First, even though I did wing it quite a bit, I also came into the story with loads of prep work.
1.) It takes place in a world which I've been cooking for decades, but not your usual fantasy sort of world -- in that it was an alternate world without any sf or fantasy elements. Everything that sf people would say "no, you're doing it wrong" is exactly the stuff I'm intentionally putting in; it's what I'm writing it for. I've been circling in for a while, trying to find a wedge to let people into the story. I finally decided to use an old fantasy trope (travel between worlds) to give the audience a way in. THIS story is from outside the existing story cycles, but it sits right on top of decades of mulling.
2.) It's just a novella, and I never intended it to be more, so it doesn't need a complicated plot. A few complications sprouted and it was longer than I expected, but that was okay, because it wanted it to have a little more substance. (And over the years, I knew I could trust this to happen.)
3.) Before I decided to make it an actual serial (I'd always called it "The Serial" because it's based on old silent movie serials), I thought quite a lot about how to make this story work for the series, and I did beat out the opening sequence... and I even blogged about it in a kind of live blogging exercise. http://daringnovelist.blogspot.com/2011/04/my-live-real-choices-beat-by-beat-as-i.html
4.) The episodes were really short, so I had lots of time to plan, and I didn't have to get very far at a time.
So that's where I was when I started: I had the relatively simple problem that had to be resolved (rescue Thorny) so I could throw complications at that all I wanted. I had a good idea of where it would go for about seven or eight episodes (which gave me a month to think about the rest.
From there, I sat down and beat-out my options each week so I had an idea of where I was going. By the time I was halfway though, I had a pretty good episode by episode outline, but I changed it freely. I dropped some plots, expanded others. Sometimes I got the episodes done ahead of time, but mostly I was sweating it up to the last minute: my main problem being that the episodes were so very short, I had to really circle and think and decide what the main thrust of the episode was. There was only room for one thing in each episode, so what was it?
The thing that most surprised me, as I wrote, was actually the characters from the main story. I didn't plan to use them much. Alex is a secondary character in the main story, and I thought I'd just tell his story, and maybe see how many characters from other stories I could incidentally introduce. And one of those characters took the bit in his mouth and ran with it. He took a complication and made it a subplot.... (Surprised the heck out of me when he did it, too.)
Which forced me to play with ways to resolve that too, though it will carry on into next summer's story, or perhaps the one after.
But as for advice to others.... every book is different and every writer is different.
You can certainly come up with a satisfying ending even if you don't have it in mind from the start. You may want to look back at your opening episodes for guidance.
Oh... one more thing, in terms of structure, whether you do it before or after, I find it useful to think of a story in a four-act movie structure, with the story divided into approximate quarters (note that classic movie structure has only three numbered acts -- but Act 2 has two parts):
Act 1 - Set up. The character's life is thrown out of balance. This act usually ends with some variation of the character realizing that the problem is bigger than expected, and so commits to the "quest" of resolving the problem.
Act 2a - The premise of the story comes into full bloom. Whatever your story seems to be about (the stuff on the book jacket, or the blurb, or the movie trailer) comes to fruition here. This section can end on a high note (great success) or low note (utter failure), but it ends when the character and audience realize that the stakes are actually much higher than they assumed.
Act 2b - Reversal and revelation. Whether the previous section ended well or badly, generally things fall apart in this section. The characters have to do some thinking and soul searching, or try something else. This section tends to be full of dark days and secrets revealed. By the end of it the character understands the true nature of the problem.
Act 3 - Taking it to the Villain's Den. Whether the villain is an actual character, or just something symbolic (as in a literary story where a character is fighting his or her own weaknesses), the final act is where the main character girds himself and heads in to settle it.
Do I adhere to this structure? Not consciously, but I do use it to spot points where things are going wrong. For the most part, I just consider that each act will have a major change of direction for the the characters. But I do find it useful to consider that the character is going in ONE direction per act. And I try to decide what will change that direction before I get to it. But when you think of it that way, it's easier to write in arcs which build to the major change.