I have a universal notebook power supply that use tips.
I also wondered what the implementation was, so I cracked open one of the spare tips. They did what I would have done - just used a couple of resistors. There are 4 contacts on the connection to the "brick", but of course only 2 to the laptop.
There are 2 ways to do it - analog and digital (didn't put a 'scope on it to see which they used) Digital - use resistors to digitally encode at least several hundred tip ids using resistor combinations - there would be a small CPU (something like a Cypress PSoC device) in the brick that measures the resistors, and figures out which tip has been connected, and sets the polarity and voltage.
The Analog method is dumber - use the resistors as a simple feedback divider.