Salesforce SDE OA2024 | Minimize Malware Spread & Partition Array Into Two Equal Halves

Salesforce · Question · Posted Jun 2026

Problem 1 - Network Virus Spread Problem Statement You are given a network of N computers represented by an N × N adjacency matrix graph. graph[i][j] = 1 indicates that computer i and computer j are directly connected. You are also given an array initial containing the computers initially infected by a virus. The virus spreads throughout all connected computers. You are allowed to permanently patch and immunize exactly one infected computer before the virus spreads. Return the index of ...

The full answer & interview discussion are available to premium members.

Log in Create a free account