FastPrepKeys and Rooms
Problems/Keys and Rooms

Keys and Rooms

Atlassian logoAtlassian● MediumFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Atlassian full-time online assessment. The report links to the exact Keys and Rooms exercise. The function you write follows that linked exercise.

Room zero is initially unlocked. Each room contains keys to other rooms. Return whether all rooms can be visited.

Function

canVisitAllRooms(rooms: List<List<Integer>>) → boolean

Examples

Example 1

rooms = [[1],[2],[3],[]]return = true

Keys discovered in order unlock rooms 1, 2, and 3.

Constraints

  • 1 <= rooms.length <= 10000
  • Every key is a valid room index.

More Atlassian Online Assessment questions

  • Planning ProductionOA · Seen Feb 2025
  • K-Means ClusteringOA · Seen Feb 2025
  • Minimum Sorted Erasure OperationsOA · Seen Jun 2024
  • Count Analogous ArraysOA · Seen Mar 2024
  • Get Maximum ScoreOA · Seen Mar 2024
  • Better Compression 🦀OA · Seen Mar 2024
  • Romanizer 🐡OA · Seen Mar 2024
  • Flower Bouquets 💐OA · Seen Mar 2024
  • Binary Search Tree IteratorOA · Seen Nov 2023
  • Binary Tree Level Order TraversalOA · Seen Nov 2023

Similar questions at other companies

  • Base Unit ConversionsAdobe · OAAdobe interview questions
  • Part 1: The Narrowest KeyScale AI · OAScale AI interview questions
  • Minimum Unreachable WarehousesVisa · OAVisa interview questions
  • Minimum Cleaning Robot RunsHSBC · OAHSBC interview questions
  • Supply Path OptimizationInMobi · OAInMobi interview questions
  • Number of IslandsGoldman Sachs · OA · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions
  • Maximum Data Transfer TimeMicrosoft · OAMicrosoft interview questions
  • Validate a DFS Traversal OrderRippling · OARippling interview questions
  • Converging Maze: Largest Sum CycleJuspay · OA
  • Maximum Damage PatchGecko Robotics · OA · PHONE SCREEN

Atlassian interview experiences

  • Atlassian MLE Phone Screen: Model Deployment Design: 1 Experience
  • Atlassian Coding Screens and Karat: 3 Experiences (Part 2 of 2)
  • Atlassian Full Stack Interviews: 11 Experiences (Part 1 of 2)
All Atlassian interview questionsSee Atlassian hiring insights
Saved
class Solution {
    public boolean canVisitAllRooms(List<List<Integer>> rooms) {
      // Write your code here.
    }

}
Checking account…