When reading the Harry Potter series, I couldn't help but notice: Harry destroyed Tom Riddle's diary with a basilisk fang, and later in the series we find out that its poison can be conveniently used to destroy Horcruxes, and the diary was conveniently one of those Horcruxes.

With example above, I came up with a __possible__ chain of logic: Destroy the diary with a fang to make Harry cool -> make diary a Horcrux -> Horcrux can be destroyed with basilisk poison because it was used in a previous book).

All above led me to this question: __Is there any information on how was the plot of the Harry Potter series developed?__ Did Rowling already make an outline for the plot of the entire story, and was just modifying it as time went on; or was she creating the plot of the next book based on what she wrote before, and then just tied all the knots together?