When is a FPGA preferred instead of a CPLD, and vice versa?
CPLDs are mostly used for random logic that used to be implemented using individual TTL and CMOS chips. FPGAs tend to be used for complete systems or complex sub-systems. There will obviously be some overlap, and Altera CPLDs are actually small FPGAs with on-chip configuration memory.

FPGA I/Os can usually be tri-stated.