Drawing Edge
Updated
Problem statement
A network has n distinct nodes. Every pair of different nodes can either have one undirected edge or remain disconnected; self-edges are not allowed.
Return the number of distinct network configurations modulo 10^9 + 7.
Function
drawingEdge(n: int) → intExamples
Example 1
n = 3return = 8For three nodes A, B, and C, the possible edges are AB, AC, and BC. The eight configurations are:
- no edges
- only
AB - only
AC - only
BC ABandACABandBCACandBC- all three edges
Each of the three edges has two independent states, so there are 2^3 = 8 configurations.
Constraints
1 <= n <= 10^9
More Snowflake Online Assessment questions
- Safest Shortest Path Through a GridOA · Seen Nov 2026
- Find Valid SET Card TriplesOA · PHONE SCREEN · Seen Nov 2026
- LFU CacheOA · ONSITE INTERVIEW · Seen Nov 2026
- Minimum Index Distance Between Person and CakeOA · PHONE SCREEN · Seen Nov 2026
- Minimum N-ary Tree Depth DeletionsOA · PHONE SCREEN · Seen Nov 2026
- Sum of Binary Tree Boundary NodesOA · PHONE SCREEN · Seen Nov 2026
- Optimal TransferOA · Seen Oct 2026
- Generating Login CodesOA · Seen Sep 2026
- String Formation (Also for AI/ML Software Engineer Intern :)OA · Seen Sep 2026
- Minimum Clicks Between Wiki PagesOA · PHONE SCREEN · Seen Sep 2026
Similar questions at other companies
- Drawing EdgeWeRide · OAWeRide interview questions
- Drawing EdgeIBM · OAIBM interview questions
- Count OperationsWells Fargo · OAWells Fargo interview questions
- Enough Muffins for the LineSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
- Next Pascal Row CoefficientIntuit · OAIntuit interview questions
- Subarray SumVisa · OAVisa interview questions
- Process SchedulingCitadel · OACitadel interview questions
- Unique Digits in RangeAgoda · OAAgoda interview questions
- Ordered Book Displays with a Featured BookIMC Trading · OAIMC Trading interview questions
- Find Max Number of PairsRoblox · OARoblox interview questions