The Schwerer Gustav is one of the largest guns ever used - by many measurements, it is the largest. But it lacks range. It was, however, designed to be an extreme bunker buster, a job which it could do very well.
On the other end of the spectrum, the Paris Gun had an incredible range - But, being designed as a psychological weapon, it lacked power and accuracy.
What they both lacked was mobility, which severely limited their usage.
Here's where we get theoretical: Presume we have a gun that combines the power and accuracy of the Schwerer Gustav with the range of a Paris Gun. Of course, it's not as powerful as the Gustav, and it doesn't have the entire range of the Paris Gun, but it's both long range and heavy hitting.
Now, we're on a world with WWII-level warship and metalworking technology. The order goes out: We want one of these guns put on a ship, to be able to sail around the coasts of our enemies and be capable of bombarding inland targets. The requirements:
- The ship only requires one of these Bombardment Cannons.
- The Bombardment Cannon must be able to traverse independent of the ship, as much as possible without compromising the ship or weapon.
- The Bombardment Cannon must be able to fire while the ship is under way. While obviously not preferred, we can't always have things our way.
- The Mounting Ship must be able to have secondary weapons for self defense. While aircraft are not currently a large threat, they are beginning to show up, so some anti-air capability is required.
So, now that we have the background and required information: What would such an "Extreme Bombardment" ship even look like, and how large would it be? I'm presuming that a turret mount is out of the question due to the sheer size of the gun, so what sort of traverse would we be able to get?
Some Notes: Aircraft are not developed at this time, nor are aircraft carriers. While aircraft will be superior, that fact is irrelevant. This also is not necessarily something that would be practical - More of an influential politician's "good idea" that's pushed through regardless of some better ideas.
Some Further Notes There have been many answers and comments that this is probably the least practical way to bombard someone. That's entirely the point. In-universe, it's the idea of a particularly influential politician, influential enough to get it designed and built. It doesn't have to be particularly effective, it just has to exist.