FastPrepPlague Survivor Prediction (Game Adaptation)
Problems/Plague Survivor Prediction (Game Adaptation)

Plague Survivor Prediction (Game Adaptation)

Roblox logoRoblox● MediumNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: This is a game version that we wrote. The candidate reports finding the foxes that will die of plague in a cognitive assessment. We chose contact edges, transmission at the same time, the first infection, the time horizon, and what a survivor is. This does not reproduce the original game or a reported coding question. Our version is about 40% the same as the reported question.

Game model. This exercise uses an explicit infection model.

For this exercise, animals have IDs 0..n-1. Each row [a,b] in contacts means animals a and b are in contact; infection can spread in either direction. The animals listed in infected are infected at round 0. During each round, all infected animals spread the infection to their uninfected neighbors at the same time. Newly infected animals start spreading in the next round. Infection never disappears.

An animal is a survivor in this model if it remains uninfected after exactly rounds rounds. Return the survivor IDs in ascending order. An animal infected at round 0 is never a survivor. Keep all inputs unchanged.

Function

plagueSurvivors(n: int, contacts: int[][], infected: int[], rounds: int) → int[]

Examples

Example 1

n = 4contacts = [[0,1],[1,2],[2,3]]infected = [0]rounds = 1return = [2,3]

After one round only animals 0 and 1 are infected.

Example 2

n = 4contacts = [[0,1],[1,2],[2,3]]infected = [0,3]rounds = 1return = []

The two initial infections reach every animal after one round.

Example 3

n = 3contacts = [[0,1]]infected = []rounds = 100return = [0,1,2]

With no initial infection, every animal remains uninfected.

Constraints

  • 0 <= n <= 2000; 0 <= contacts.length <= 10000.
  • Every contact joins two different valid IDs; undirected contacts are unique.
  • infected contains unique valid IDs and may be empty.
  • 0 <= rounds <= 1000000000.

More Roblox Online Assessment questions

  • Centered Block Placement QueriesOA · Seen Oct 2026
  • Robot Navigation Around LasersOA · Seen Oct 2026
  • Factory Batch Profit (Game Adaptation)OA · Seen Sep 2026
  • Nested Recipe Blocks (Game Adaptation)OA · Seen Sep 2026
  • Vehicle Builds for Required Terrain (Game Adaptation)OA · Seen Sep 2026
  • Track Received Byte RangesOA · Seen Sep 2026
  • Break a PalindromeOA · Seen Jun 2026
  • Count Pairs Differing in One DigitOA · Seen Oct 2025
  • Find Zero Cells in a 2×2 GridOA · Seen Oct 2025
  • Cat Route Budget Planning (Game Adaptation)OA · Seen Aug 2025

Similar questions at other companies

  • Delivery Management SystemAkuna Capital · OAAkuna Capital interview questions
  • Minimize CommuteDatabricks · OA · PHONE SCREENDatabricks interview questions
  • Tree Pythagorean TriplesIBM · OAIBM interview questions
  • Shortest Atom Action PathOpenAI · OAOpenAI interview questions
  • Distances to CyclesBelvedere Trading · OA
  • Shortest Path from an Encoded GraphIntuit · OAIntuit interview questions
  • Minimize Malware Spread by Removing a NodeVisa · OAVisa interview questions
  • Longest Distance in a Frequency-Limited NetworkBloomberg LP · OABloomberg LP interview questions
  • Minimum Cleaning Robot RunsHSBC · OAHSBC interview questions
  • Find Minimum City HopsAmazon · OA

Interview reports that mention this question

  • Roblox New Grad CodeSignal Finals: 23 Experiences (Part 4 of 7)

Roblox interview experiences

  • Roblox New Grad Early OA Tasks: 10 Experiences (Part 7 of 7)
  • Roblox New Grad Engineer Rounds: 13 Experiences (Part 6 of 7)
  • Roblox New Grad HackerRank OA: 18 Experiences (Part 5 of 7)
  • Roblox New Grad Games and BQ: 25 Experiences (Part 3 of 7)
  • Roblox New Grad Coding Rounds: 23 Experiences (Part 2 of 7)
All Roblox interview questionsSee Roblox hiring insights
Saved
class Solution {
    public int[] plagueSurvivors(int n, int[][] contacts, int[] infected, int rounds) {
        // write your code here
    }

}
Checking account…