Sam sat at the table, quietly sipping her wine while the rest of us recounted our recent failures. The conversation focused on the vagaries of encroaching middle age: Struggles with infertility, child-rearing challenges, ailing parents.

I looked at Sam and wondered what she was thinking. Nearly 15 years younger than me and my dining companions in our late 30s and early 40s, did she pity us? Was she bored? Or worse: Had we become those people you don’t want to become when you grow up?

We had met at work. By the time of this dinner, all of us had moved on to new jobs except for Sam. Our blossoming friendship had taken me by surprise. At work, I was surrounded by twentysomethings, most of whom I regarded with bemused detachment. Their minor crises unfolded like the latest CW drama: entertaining from afar but usually trivial.

At the office, I spent my days dissecting the desires and behaviors of the millennial. I developed marketing strategies aiming for that cohort, a generation of over 80 million people. It requires large brush strokes to paint a generation as broad and diverse as millennials into a cohesive whole. They’re Pollacks, not Rothkos.

Yet it wasn’t until I befriended Sam that I understood. In some ways she embodies the typical traits of the millennial. She loves a selfie. She was hired as a social media expert. She has strong feelings on Taylor Swift vs. Katy Perry (she’s Team Katy). The fall of the Berlin Wall isn’t a cultural touchstone for her. The implied threats of the Cold War seem quaint to someone who spent her formative years in the wake of Sept. 11.

She took it upon herself to educate me in contemporary pop culture. She chastised me for using a period at the end of my texts (“It makes you sound cold and sarcastic”); or posting too often on Instagram (“no more than one per day”). We bonded over a mutual love for our favorite millennial trainwrecks on “Broad City.”

I helped provide context to cultural references she missed, like the origin of the phrase “bunny boiler” from “Fatal Attraction” or the impact of the O.J. Simpson trial long before the FX miniseries premiered. She once tried to compare being a fan of One Direction when she was younger to being a fan of Prince in the 1980s. (I was aghast.) When we’d go out after work, I tried to match her drink-for-drink and failed miserably.

Sam’s father died not long before we met. Most of her friends her own age, while sympathetic, probably couldn’t relate to her sense of grief. I suspected that was part of our appeal to her. Even if we hadn’t lost a parent, by our 40s none of us were strangers to loss and all of us were contemplating our parents’ mortality.

Her generation is often portrayed as vapid and entitled. Yet Sam doesn’t play neatly into hipster stereotypes. She doesn’t eat artisanal doughnuts. Her favorite restaurant is — unironically and unequivocally — the Cheesecake Factory. She would rather be forced to attend a Ted Cruz rally than refer to herself a “creative entrepreneur.” She doesn’t long for an analog existence she never experienced, full of vinyl records and vintage typewriters.

Meanwhile, many of my fellow Gen Xers are trying desperately to preserve a fragment of their former punk-rock selves, blasting the Pixies on the way to school drop off. Our younger colleagues are a constant reminder of our impending irrelevance. When I explained my friendship with Sam to a more age-appropriate friend, he gently asked whether this was a desperate attempt to cling to my youth. The platonic version of running off with a younger woman.

There is some truth to that.

Who doesn’t long for the relatively uncomplicated dilemmas of our 20s? As my friends and I rack up big problems, there is an allure to an effortless friendship like the one I have with Sam. I can’t help my friends solve their infertility struggles. Or prevent a parent from dying. Or help raise an autistic child. Or pay down a mortgage while the career path they chose implodes around them. The stakes are so much higher in our 40s.

Sam’s problems, for the most part, are solvable. Career stress and inconsiderate roommates can be handled. With Sam, I can offer advice on dealing with office politics. I can listen and nod sympathetically when she needs to vent about something a roommate did. When one of her friends acts selfishly (as twentysomethings so often do), I can counsel her on how to react.

The day after our dinner I texted her, thanking her for being such a good sport the night before. I worried that our incessant grumbling had alienated her. On the contrary, she assured me, she found it fascinating.

Maybe Sam understood something I hadn’t yet grasped. Rather than scaring her about what her future might hold, perhaps we served as models of resilience. A way to move forward with grace and humor even as life’s indignities accumulate.

And even if my low tolerance for alcohol meant I couldn’t go toe-to-toe on cocktails, at least I could afford to buy her drinks.