Here are the results of two google searches of "Price for 2012 21.5" iMac i5 2.7 ghz:
$300 seems like a real good price. Also, that iMac can run Apple's latest OS, High Sierra, OS 10.13.6.
As far as checking things out, when the machine boots up, if it asks for a password, that means their old password is still "active". If it boots up and starts asking for setup information, then there should be no old passwords on the machine. That also means there is an OS on the machine. It would be best if you find out what that is.
Did the ad say how much memory it has? Also, does it still have the original internal disk drive that came with the machine?
If this is the machine:
then it has 8 gig of Ram (that's good), and a 1 TB 5400 RPM internal drive (somewhat slow, but it gets the job done).
Finally, is the seller including any third party (ie, non-Apple) software?
If there is an OS on the machine, and you want to check out the internal drive, when the machine starts up, hold down the Command Key (should be to the left (and right) of the space bar) and R key at the same time. This will boot to the (hidden) Recovery HD partition, described here:
Select Disk Utility from the screen/menu that appears, and then select the internal drive, and select First Aid. That will verify (and if needed, repair) the internal drive. It will also tell you if there are any issues with the drive.