Most stainless steel tanks still require a sacrificial anode, even Solahart units have them and recommend servicing them regularly to prolong the useful life of the hot water system.
Finding out the age of the hot water system is often difficult as most companies have a different serial number code system, although some manufacturers have it listed on the pull out panel where you can relight the burner on a gas unit. Often external electric units have a label that has faded or peeled off, due to sunlight or just the weathering of the unit.
Rinnai hot water systems often have a 10 figure serial number, the first two digits are the month, the next two are the year, Rheem can be shown the same way, but this may differ on some models. Thermann show the year first then the month of manufacture. So often it is difficult to work out the date of manufacture. Older houses rarely have the original hot water service and if they do, they probably require replacing.
Instantaneous units have no tanks and should last 20 years minimum. Most houses that have replaced the original tank systems, install an instantaneous system as they are cheaper to run, purchase and do not run out of hot water.
The external wall mounted instantaneous systems also often have no label to show the date of manufacture, as they have peeled off or faded.
So its best to allow for a hot water replacement in your plans, if you're buying an older established home and a hot water tank is still in use.
.