President Trump has been moving inexorably toward Friday’s high-stakes summit meeting since Election Day. He campaigned on a pledge to seek better relations with Russia’s President Vladimir Putin. And since November, his aides have assumed that Trump’s first real test would be a belligerent North Korea.

These two challenges — Russia and North Korea — will converge in the meetings that will take place in Hamburg on Friday and Saturday. The other major players at the Group of 20 summit pose subtle problems, too: China, Japan, South Korea, Germany, Turkey and Saudi Arabia. For an inexperienced American president, it will be a steep learning curve.

Summits occasionally intersect with looming military crises, as is the case with Hamburg. Looking back over the record of famous top-level encounters, you can find some epic failures: Munich in 1938; Yalta in 1945; Vienna in 1961. Each is the story of a Western leader who blundered in thinking he could rationally accommodate a dictator.

Henry Kissinger wrote in his memoir “White House Years” of Moscow’s canny evaluation of U.S. diplomacy on the eve of a May 1972 summit between President Richard Nixon and Soviet Premier Leonid Brezhnev: “They doubted whether America could sustain both the willingness to confront and the readiness to cooperate at the same time.” The Russians and Chinese are doubtless asking the same question this week about the United States.

Trump’s erratic tweets and public statements make it hard to predict his diplomatic strategy in Hamburg. That’s partly by design; Trump thinks he gains leverage by making others uncertain. But the rhetorical zigzags also represent genuine uncertainty within this contentious White House. This president may be a dealmaker, but he’s not a strategist.

In its pre-summit planning, the White House has seemed to be preparing for two broad moves: a new joint effort with Russia to stabilize Syria, and a threat-backed campaign to pressure North Korea to suspend missile and nuclear tests. Both are worthy goals; but each will require a diplomatic finesse that Trump, in his first six months in office, has rarely shown.

This weekend’s summitry will be complicated by the interaction of so many big egos, all looking for a “win.” Trump is the most volatile personality, prone to respond impulsively when he feels cornered. Putin is the cold-blooded ex-spy with a chip on his shoulder, eager for validation after three years of sanctions and isolation. Chinese President Xi Jinping is the “princeling” autocrat who leads the world’s most dynamic economy. And offstage in Pyongyang is Kim Jong Un, the baby-faced dictator racing to build nuclear missiles.

Trump is the least experienced of the group. Given his unpopularity at home and with most traditional U.S. allies, he has the most to gain or lose. According to national security adviser H.R. McMaster, Trump has “no specific agenda” for the meetings with Putin. He may hope for a genial get-acquainted session as with Xi at Mar-a-Lago, but that’s not Putin’s style. Trump would be wiser to go armed with a short list of ways the U.S.-Russia relationship can be improved — and Russian political meddling curbed.

In containing North Korea’s nuclear ambitions, Trump would be wise to emulate the too-much-maligned approach to Iran of former president Barack Obama . He should build a coalition of countries that share the United States’ view that the North Korean nuclear and missile testing must stop; he should offer direct negotiations if North Korea agrees to suspend testing while the talks continue; and he should build a high-tech offensive and defensive arsenal (remember Stuxnet?) in case the talks fail.

Summitry under military pressure is especially fraught. When British Prime Minister Neville Chamberlain went to Munich in September 1938, war fears were so intense that Britain mobilized its fleet and began distributing gas masks. A frightened public accepted Chamberlain’s capitulation to Adolf Hitler.

At the Yalta summit in February 1945, President Franklin Roosevelt and British Prime Minister Winston Churchill, sensing victory ahead, unwisely agreed to Soviet demands that paved the way for the division of Europe. “If only I could dine with Stalin once a week, there would be no trouble at all. We get on like a house on fire,” enthused an overconfident Churchill, quoted in David Reynolds’s 2007 book, “Summits.”

President John F. Kennedy said privately after a nasty June 1961 summit in Vienna with Soviet Premier Nikita Khrushchev, “He just beat the hell out of me.”

Trump will probably say he won the Hamburg summit game, no matter what. The test will be whether this meeting helps dampen some of the fires burning dangerously around the world.

Read more from David Ignatius’s archive, follow him on Twitter or subscribe to his updates on Facebook.