An interest rate swap is an agreement between two parties to exchange interest rate payments over time. There are several types of interest rate swaps, including plain vanilla swaps where a floating rate is exchanged for a fixed rate. Basis swaps allow the exchange of variable rates tied to different reference rates, such as LIBOR and treasury bill rates. An example shows how an interest rate swap could benefit companies A and B - company A pays a fixed 8% instead of a floating LIBOR+1%, while company B pays a floating LIBOR+3% instead of a fixed 12%, reducing their combined interest costs.