“… Because the ticktock drama about danger-prone federal agent Jack Bauer is and always has been a work in progress, the ending will be figured out along the way … ‘We’re lucky, at the beginning of the year, if we know where it starts,’ one of the executive producers, Howard Gordon, told television critics this month.’ I think that’s part of what gives the show its energy, is we paint ourselves into corners and blast our way out.’ … Sutherland said he has learned to believe in the writing team, but still, ‘It scares us.’ But ‘after five years, I think we’ve got some faith in the way we’re figuring this out,’ he said.… executive producer, Evan Katz, said that at its best, production is two episodes ahead of the scheduled air date.
‘We know in general we’ll avert a terrorist threat or conclude the conventional story, but we begin the year sort of pretending we have the first four to six. But even as we’re writing those, they change.'”
Article about how the writers on the show really do wing the story, week by week.
source : kentucky.com