FastPrepCyber Beacon Detection
Problems/Cyber Beacon Detection

Cyber Beacon Detection

Rippling logoRippling● MediumFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Rippling online assessment. The report gives the beacon_signal function with seven integers, a long count, and the rectangle and beacon example that lights up three nodes. We chose the descriptive function name and the number limits. Our version is about 95% the same as the reported question.

A network is modeled as every integer-coordinate node inside an axis-aligned rectangle whose bottom-left corner is (x1, y1) and top-right corner is (x2, y2). Both rectangle boundaries are inclusive.

A beacon centered at (beaconX, beaconY) completely illuminates a node when the node's Euclidean distance from the beacon is at most radius.

Return the number of network nodes that are completely illuminated.

Equivalently, count the integer pairs (x, y) that satisfy both rectangle bounds and (x - beaconX)^2 + (y - beaconY)^2 <= radius^2.

Function

countIlluminatedNodes(x1: int, y1: int, x2: int, y2: int, beaconX: int, beaconY: int, radius: int) → long

Examples

Example 1

x1 = -2y1 = -2x2 = 2y2 = 2beaconX = 0beaconY = 0radius = 1return = 5

The illuminated nodes are the center and its four axis-adjacent neighbors.

Example 2

x1 = 0y1 = 0x2 = 2y2 = 2beaconX = 0beaconY = 0radius = 2return = 6

The six points are (0,0), (0,1), (0,2), (1,0), (1,1), and (2,0).

Example 3

x1 = 5y1 = 5x2 = 7y2 = 7beaconX = 0beaconY = 0radius = 2return = 0

The rectangle does not intersect the illuminated circle.

Example 4

x1 = 0y1 = 0x2 = 1y2 = 1beaconX = 0beaconY = -7radius = 8return = 3
Example 4 illustration

The rectangle has four nodes. The nodes (0,0), (1,0) and (0,1) are at distances 7, about 7.07 and exactly 8 from the beacon, so they are lit. Node (1,1) is about 8.06 away, just outside the radius, so the answer is 3.

Constraints

  • -10^9 <= x1 <= x2 <= 10^9
  • -10^9 <= y1 <= y2 <= 10^9
  • -10^9 <= beaconX, beaconY <= 10^9
  • 0 <= radius <= 10^9
  • x2 - x1 <= 2 * 10^5

More Rippling Online Assessment questions

  • Most Segments That Sort the ArrayOA · Seen Nov 2026
  • Palindromic Paths to the RootOA · Seen Nov 2026
  • Server InvestmentOA · Seen Nov 2026
  • Corporate Card Expense RulesOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • REST API: Highest International StudentsOA · Seen Sep 2026
  • Token ValidationOA · Seen Sep 2026
  • Consistent LogsOA · Seen Sep 2026
  • Costliest ChocolateOA · Seen Sep 2026
  • Server ManagementOA · Seen Sep 2026
  • IPv4 Address ClassificationOA · Seen Aug 2026

Similar questions at other companies

  • Count Pairs of Overlapping SquaresCapital One · OACapital One interview questions
  • Server Upgrade PlanningWells Fargo · OAWells Fargo interview questions
  • Perfect Squares Matching a PatternNielsen · OA
  • Maximum Alloy Production Within BudgetMicrosoft · OAMicrosoft interview questions
  • Linear InterpolatorTwo Sigma · OATwo Sigma interview questions
  • Rock JumpingIMC Trading · OAIMC Trading interview questions
  • Count Lucky Numbers in a RangeTarget · OA
  • Souvenir Shop PurchasesAmazon · OA
  • TikTok Video Relevance AdjustmentTikTok · OATikTok interview questions
  • Paint the CeilingSnowflake · OASnowflake interview questions

Interview reports that mention this question

  • Rippling Intern Interview History: 17 Experiences (Part 5 of 5)

Rippling interview experiences

  • Rippling Senior SWE Full Loop Questions: 1 Experience
  • Rippling Experienced SWE Phone Screens: 2 Experiences
  • Rippling Design Rounds and Onsites: 17 Experiences (Part 3 of 3)
  • Rippling Phone Coding Screens: 14 Experiences (Part 2 of 3)
  • Rippling SWE Screens and Loops: 31 Experiences (Part 1 of 3)
All Rippling interview questionsSee Rippling hiring insights
Saved
class Solution {
    public long countIlluminatedNodes(int x1, int y1, int x2, int y2, int beaconX, int beaconY, int radius) {
        // write your code here
    }
}
Checking account…