Most of the expired domains are deindexed, while google does deindex the sites, once you put it back up, Google looks for the old files again. This is probably a bug everyone can use to their favour, so I would suggest you to buy a new domain, build it in your favour. This will reduce the risk. It is not possible to index again if the expired domain is deindexed due to some spammy links I would suggest you to do some research on it and find the history of the site. If you are satisfied with the site then go ahead for buying it