Summer Sale
Limited Time Deal: Unlock all premium questions for over 30% off
14
:
03
:
45
:
17
Longest Prefix Router
You are building a network packet forwarder. Given a routing table and a list of incoming packet source addresses, determine the correct gateway for each packet using longest prefix match (LPM).
The routing table is a list of [prefixCIDR, gateway] pairs. For each packet IP address, find the route whose prefix is the longest (most specific) match. If multiple routes match, the one with the longest prefix length wins. If no route matches, return "" for that packet.
...
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.