HARDasked at 1 company

Minimum Degree of a Connected Trio in a Graph

A hard-tier problem at 43% community acceptance, tagged with Graph. Reported in interviews at Meesho and 0 others.

Founder's read

You're staring at a graph problem that asks you to find a connected trio (three nodes with edges between all pairs) and minimize the sum of their degrees. Meesho has asked this one. It's a hard problem sitting at 43% acceptance, which means most candidates either miss the optimization angle or build the brute force and hit time limits. The trap is treating it like a simple traversal when it's really about understanding degree sums and efficient enumeration.

Companies asking
1
Difficulty
HARD
Acceptance
43%

Companies that ask "Minimum Degree of a Connected Trio in a Graph"

If this hits your live OA

Minimum Degree of a Connected Trio in a Graph is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code.

Get StealthCoder
What this means

The key insight: a connected trio is a triangle in the graph, and you want the one where the sum of the three nodes' degrees is smallest. Brute force enumerates all triples and checks if they form a triangle, which works for small graphs but fails at scale. The real pattern is to iterate over edges and, for each edge, count common neighbors. For every common neighbor, you've found a triangle, and you can track the minimum degree sum on the fly. This avoids checking non-triangles and runs in O(E sqrt(V)) time with adjacency lists. Most candidates either miss the degree-sum optimization entirely or write code that's correct but slow. If you hit this in a live OA and blank on the enumeration trick, StealthCoder surfaces the working solution in seconds, invisible to the proctor.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Minimum Degree of a Connected Trio in a Graph recycles across companies for a reason. It's hard-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Minimum Degree of a Connected Trio in a Graph interview FAQ

Is this really a hard problem or does it just have a hard label?+

It's genuinely hard. The 43% acceptance rate confirms it. Most people can write code to find a triangle, but optimizing the search and tracking degree sums under time pressure is where the difficulty lies. The trick isn't immediately obvious without prior exposure.

Does Meesho actually ask this or is it old data?+

Meesho is the only reported company asking this, so it's either a recent favorite or part of their medium-to-hard rotation. If you're interviewing there, this pattern matters. For other companies, treat it as valuable graph optimization practice.

What's the common mistake candidates make?+

Writing a triple loop that checks all possible trios for connectivity. It works but times out. The better move is to iterate edges and find common neighbors in their adjacency lists. This drastically cuts the search space and passes.

How does this relate to other graph problems I should know?+

It combines triangle detection with optimization. If you're solid on adjacency list iteration and neighbor enumeration, you've got the foundation. This problem adds a minimization layer that forces you to think about degree tracking alongside structure.

Can I solve this in Python fast enough or do I need C++?+

Python works fine if your logic is tight. The bottleneck isn't language, it's algorithm. Use sets or lists for adjacency and avoid redundant checks. A clean O(E sqrt(V)) implementation in Python beats a naive triple-loop solution in C++.

Want the actual problem statement? View "Minimum Degree of a Connected Trio in a Graph" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.