As far as I can tell, Rowling had planned out A LOT of details for the main plot of all 7 Harry Potter books even before publishing the first. Such questions have been asked here before (such as this).
But still, I can't help feeling that the plot of horcruxes weren't really thought about until book 4/5. To elaborate; in book 2, she wrote that Voldemort had put a part of himself/his soul into the diary, but I'm not convinced she had already planned that he had also put parts of himself into other items AND that they all needed to be destroyed in order to defeat him.
My thoughts are that if the horcruxes were planned from the start; it's a good plot, but I feel that we should've been given a bit more insight other than "it was a memory".
But if the horcruxes weren't planned from the start, but rather added as a main plot in later books (4/5), that's so much more impressive. The horcrux-plot she made to perfectly incorporate that the diary was a horcrux, it's so well done.
Do we know if Rowling knew that the diary had to be destroyed in order to defeat Voldemort, when she wrote the Chamber of Secrets? Did she also know that the reason Voldemort didn't die in the end of the first book (philosopher's stone) was partly because of the part of his soul in the diary specifically? Or were these plot arches connected later?