It is illegal but many employers do it.