The answer is to book a cabin towards the centre of the ship on a deck that is sandwiched between decks that only have accommodation on them. Just avoid cabins that have busy public areas such as theatres, restaurants, etc above or below them. As BLYTH say, you mainly get mechanical noise on older ships, but any cabin can suffer from the odd noise caused by air conditioning, etc. Just pray that you don't get noisy neighbours! As a rule, the lower the deck, the lower the price, and inside cabins are usually the same size as outside ones, but cheaper. Happy cruising.
The lower down in the ship the cheaper accommodation, decks 2 and 3 but you will only have a porthole unless you go for an inside cabin the cheapest option on any deck. In the smaller older ships yes noise and vibration can be heard but not normally on the newer ones built from 1996 onwards.