Question: Most large airplanes flying today are mostly metal, which has a relatively big coefficient of thermal expansion. Cruising altitudes of commercial jets can reach 10 km or more, where the air gets down to about -50 Celsius. Room temperature is more like +25 Celsius, and I would not be surprised if that large fuselage, sitting under the sun, gets up near +50 C.

This is quite a range of temperatures to handle. It would cause some contraction/expansion of metals. The larger the piece of metal, such as a wing spar or long airframe beam, the greater the contraction/expansion.

Is this a major design problem for large aircraft, and how is it handled?

**EDIT:** only interested in subsonic designs. I'm concerned about the cold high altitude air cooling most of the fuselage and making it contract. The nose and leading wing edges might not suffer from this, but I expect the rest of the aircraft will.

Answer: 
Not thermal contraction but condensation of vapor is a problem.

Immediately, [fuselage pressurization](https://aviation.stackexchange.com/questions/15779/why-do-airplanes-have-curved-windows) is the far bigger problem that comes with the altitude changes. But if you operate in hot and moist weather, the moisture in all the air carried inside the fuselage will condense when this air cools down at altitude and will collect somewhere. If no proper drains are included (remember, drain valves and fuselage pressurization do not mix well) and maintenance is sloppy, this accumulated water can weigh several tons.

A special case are foam sandwich structures. [PVC foam](http://www.aircraftspruce.com/catalog/cmpages/divinycellfoam.php) is the standard in composite gliders, but airliners use [honeycomb sandwich](http://www.hexcel.com/Resources/DataSheets/Brochure-Data-Sheets/Honeycomb_Attributes_and_Properties.pdf) structures. When fairings made from PVC foam were tried on airliners, it was found that pressure and temperature cycles damaged the sandwich core pretty quickly. The moisture inside the cells would condense, the cells themselves would crack and bacteria would munch up the soggy remains. Only with honeycomb cores could the sandwich be made durable enough for airliner use.
The temperature range the aicraft is dealing with is actually smaller. Indeed, airliners cruise around Mach 0.85, but the velocity on the fuselage is zero. Hence a part of air kinetic energy is transfered into thermal energy. This is called the ram effect. You can find tables that give you the stagnation temperature as a function of the mach number and the altitude.