← Roblox Interview Insights

Roblox·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Roblox software engineer interview with a scheduling/subset selection problem. Pretty algorithmic, nothing too wild, but the constraints tripped me up at first.

Questions Asked (1)

Q1

Given a list of events in input order, select a subset where no two chosen events are adjacent (indices at least 2 apart). You may also have a minimum count requirement. Return whether a valid selection exists, and if so, provide one valid schedule.

Algorithms & Data Structures
Author's notes

Took me a minute to realize the greedy approach was fine here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem constraints (minimum count, whether events have weights) and then use dynamic programming to determine the maximum number of non-adjacent events selectable. If the maximum is at least the minimum count, reconstruct one valid schedule by backtracking through the DP table.

Pro tip: Always discuss edge cases like empty input, minimum count of 0, or minimum count exceeding the maximum possible; these show thoroughness and often reveal hidden assumptions.

1. Clarify requirements and constraints

Ask about the minimum count, whether events have weights or values, and if the input list can be empty. Confirm that 'adjacent' means indices differ by exactly 1.

2. Define DP state and recurrence

Let dp[i] be the maximum number of non-adjacent events selectable from the first i events. Recurrence: dp[i] = max(dp[i-1], 1 + dp[i-2]) with base cases dp[0]=0, dp[1]=1.

3. Compute maximum count and check feasibility

Iterate through the list to fill the DP table. After processing all events, check if dp[n] >= minimum count. If not, return that no valid selection exists.

4. Reconstruct one valid schedule

Backtrack from i=n: if dp[i] == dp[i-1], skip event i; else include event i and move to i-2. Continue until i<=0. This yields a valid subset.

5. Return result and discuss complexity

Return true and the reconstructed schedule, or false if infeasible. Mention time O(n) and space O(n), with possible O(1) space optimization if only count is needed.

Key Points to Mention

  • Dynamic programming state definition and recurrence relation
  • Handling edge cases: empty list, minimum count 0, minimum count > maximum possible
  • Reconstruction of the actual schedule using backtracking
  • Time and space complexity analysis (O(n) time, O(n) space, O(1) space optimization)
  • Greedy approach is not optimal; DP guarantees maximum count
  • Clarifying whether events have weights or if only count matters

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.