Type XXI Submarine (1943)
Karl Doenitz had a problem,
The German's needed to close the ocean and stop the flow of supplies into Europe from North America. The goal of the German Navy and particularly its U Boats was to attack and destroy convoy shipping.
Up until 1942, the German U Boat flotilla had a good war, the Type VII was the most common submarine in service with a flotilla of several hundred boats. But the war turned on Doenitz, the advance of Sonar technology, the tactical change to fast convoys, and the breaking of German's Enigma code turned the tied on Germany and started to lead to massive losses that meant that nearly half of the German Sailors who went to sea, stayed at sea..
The type VII boat was rapidly becoming obsolete. Because of its hull shape it was detectable by enemy sonar, it was also tremendously slow submerged and had a limited battery charge. Basically at 5 knots underwater a type VII would lose battery power in a day, at 2 knots it would lose battery power in two weeks, so the standard alliance tactic was unpredictable zig zags as well high speed freighters and escorts and long range aerial recon.
The Kreigsmarine was slowly being bled to death.
Doenitz needed a new solution, a long range submarine with the ability to attack Convoys in North American waters, they needed to be fast and quiet and had long endurance.
Out of this the German's created the Type XXI, the electroboot, the father of the modern nuclear submarine.
Whereas submarine tactics up until this point would be to have submarines run on the surface to keep their batteries charged and then submerge to either evade the enemy or duck inside a convoy to torpedo freighters, the XXI was designed to primarily operate under water. If properly developed and manufactured in enough numbers early enough, the German's may have been able to close the sea lanes.
The Type XXI was completely different from the type VII's and type IXs. Its hull shape was knife shaped like the modern SSN with no rails, bulges or holes which would create reduce noise due to water flow.

The type VII notice the railings and deck attachments and the outrigger diesel tanks that caused noise
The type XXI, there are no rails and very few deck riggings our outriders.
The Type XI had three times the batteries of the Type VII which allowed it to stay submerged for 5 days at 5 knots, More importantly the XXI had a maximum submerged speed of 18 knots where as the VII had a maximum submerged speed of 7 knots. Due to the improved diesel engines the Type XXI could snorkel and recharge in 5 hours where as the type VII would take a full day to recharge.
Weapons wise, the Type VII had 4 bow torpedo's and one in the stern, it could carry 14 torpedoes, and also had a 8 mm deck gun. The type XXI had 6 bow tubes and no stern tubes, and while it didn't have a deck gun, it had 2 heavy anti aircraft guns in its conning tower. The type XXI carried 23 torpedoes.
Unfortunately for German's they ran out of time and only 4 type XXI were completed and only two were deployed. At the end of the war the Soviets, American's, British and French all claimed type XXI and used them in their sub development programs. When you look at Russian Submarines, the Whiskey, Zulu and the well known Romeo submarines borrowed heavily from the type XXI. The American borrowed heavily from its design when it built the USS Nautilus, the Worlds first nuclear submarine.