Aged 36 and 31 respectively, both have defied the odds to collect two grand slam titles.
But another legend of the game, who is 10 months Federer's senior, has just sealed two grand slam titles in the space of 24 hours.
Martina Hingis, 36, won the women's doubles and the mixed doubles at the recent US Open, taking her overall grand slam total to 25. She partnered with Taiwan's Chan Yung-Jan to win the women's doubles title and Briton Jamie Murray to win the mixed doubles tournament.
In doing so, she returned to the scene of her first US Open singles triumph, recorded against an emergent Venus Williams exactly two decades ago.
It has been a "wonderful journey,"
to quote Hingis herself, beginning with a debut on the WTA Tour just a week after turning 14, and showing no signs of stopping as her 37th birthday approaches.
"I've always loved to play tennis," Hingis told CNN Sport's Don Riddell. "This is what I do best; this it what I know; this is my education since I was two years old."
The Swiss remains the youngest grand slam champion in history -- having won the Wimbledon women's doubles aged 15 years and 282 days alongside Helena Suková, a partner twice her age.
And she remains the youngest singles grand slam winner in the Open era -- having reached all four major finals in 1997, only missing out at Roland Garros.
"I was the youngest in most of the things I did," says Hingis. "Now, I look back at it and see [today's] juniors and young upcoming players ...You say 'Oh Jelena Ostapenko, when she won the French Open she was only 20 years old!'
"And I'm like hang on ... Back then when you were 20, if you hadn't won a grand slam by then you were almost too old!"
Hingis became the undisputed world No. 1 aged 16 and it was a position she held on and off at the top of women's tennis for a total of 209 weeks -- the fifth longest of all time -- until a series of ankle injuries forced her to retire aged 22.
Had she done too much too young?
"In my case I definitely wouldn't want to change what I went through with anyone," says Hingis. "It's a lot cooler than having to go to school."
"I did education until I was 14 when I turned pro and then some later on as well, but I think this is the best education you can get.
"My mom always made sure that when we traveled to different cities and countries that we also took something from there to learn about."
A fleeting return
Hingis came out of retirement and returned to the ATP Tour in 2006, duly lifting the Australian Open mixed doubles trophy with India's Mahesh Bhupathi.
But, hampered by injury, she was never again the same electrifying talent and, on 1 November 2007, the "Swiss Miss" announced her retirement for a second time following a positive test for metabolites of cocaine.
The former darling of women's tennis was banned by the International Tennis Federation for two years and, though she refuted the charges, this time it really did look like the end.
"I believe her when she says she's retiring permanently," commented Larry Scott,
the chairman and chief executive of the WTA at the time.
Third time lucky
And yet once again Hingis was not to be denied.
Since returning to the WTA Tour in 2013,
she has won 10 further doubles grand slam titles and insists her only major regret is relinquishing control of the 1997 French Open singles final to Croatia's Iva Majoli.
Twenty three years after her WTA debut, the game has changed but Hingis's inimitable desire to win remains the same.
And her longevity means there are few players better positioned to appreciate the grand sweep of women's tennis history.
"Sometimes I did complain that I want to see a bit more variety and a little bit of strategy in the game," she said.
"You see that more in the men's tennis, but eventually women will return to that.
"Once you are able to control that power, [you] have the variety out there again. Sometimes I think that's forgotten.
"Hey, tennis is a game. It's not just sheer power!"
Many players, both male and female, have looked up to Hingis during her long and storied career -- not least Federer himself.
"I always say I taught him how to win his first tournament," she laughs, reflecting on their mixed doubles victory at the 2001 Hopman Cup. "We ended up winning Sydney too the week after.
"There were some great moments we shared. We all know what happened afterwards."