Atlassian SDE-2 Karat Round

atlassian logo
atlassian
SDE-2
April 20, 20254 reads

Summary

I participated in a Karat round for an SDE-2 position at Atlassian, which included two distinct algorithmic challenges involving robot construction and delivery cart path analysis.

Full Experience

Question 1

Input Structure:

We have two inputs: a list of available parts and a list of required parts for each robot. Each robot's required parts are stored in a dictionary where the key is the robot name and the value is a list of parts needed. Output:

We need to return a list of robot names that can be fully constructed with the available parts.

List = [ "Rosie_claw", "Rosie_sensors", "Dustie_case", "Optimus_sensors", "Rust_sensors", "Rosie_case", "Rust_case", "Optimus_speaker", "Rosie_wheels", "Dustie_case", "Dustie_arms", "Rust_claw", "Dustie_case", "Dustie_speaker", "Optimus_case", "Optimus_wheels", "Optimus_wheels", "Rust_legs", "Optimus_sensors" ] Available Parts = {"sensors", "case", "speaker", "wheels"}

output - [Optimus, Rosie]

Question 2

You work in an automated robot factory. Once robots are assembled, they are sent to the shipping center via a series of autonomous delivery carts, each of which moves packages on a one-way route.

Given input that provides the (directed) steps that each cart takes as pairs, write a function that identifies all the start locations, and a collection of all of the possible ending locations for each start location.

In this diagram, starting locations are at the top and destinations are at the bottom - i.e. the graph is directed exclusively downward.


   A          E      J       Key:  [Origins]
  / \        / \      \                 \
 B   C      F   L      M             [Destinations]
  \ /  \   /
   K     G
        / \
       H   I

paths = [ ["B", "K"], ["C", "K"], ["E", "L"], ["F", "G"], ["J", "M"], ["E", "F"], ["C", "G"], ["A", "B"], ["A", "C"], ["G", "H"], ["G", "I"] ]

Expected output (unordered):
[ "A": ["K", "H", "I"], "E": ["H", "L", "I"], "J": ["M"] ]

N: Number of pairs in the input.

Interview Questions (2)

Q1
Construct Robots from Available Parts
Data Structures & Algorithms

Input Structure:

We have two inputs: a list of available parts and a list of required parts for each robot. Each robot's required parts are stored in a dictionary where the key is the robot name and the value is a list of parts needed. Output:

We need to return a list of robot names that can be fully constructed with the available parts.

List = [ "Rosie_claw", "Rosie_sensors", "Dustie_case", "Optimus_sensors", "Rust_sensors", "Rosie_case", "Rust_case", "Optimus_speaker", "Rosie_wheels", "Dustie_case", "Dustie_arms", "Rust_claw", "Dustie_case", "Dustie_speaker", "Optimus_case", "Optimus_wheels", "Optimus_wheels", "Rust_legs", "Optimus_sensors" ] Available Parts = {"sensors", "case", "speaker", "wheels"}

output - [Optimus, Rosie]

Q2
Robot Delivery Cart Paths (Find Start/End Locations)
Data Structures & Algorithms

You work in an automated robot factory. Once robots are assembled, they are sent to the shipping center via a series of autonomous delivery carts, each of which moves packages on a one-way route.

Given input that provides the (directed) steps that each cart takes as pairs, write a function that identifies all the start locations, and a collection of all of the possible ending locations for each start location.

In this diagram, starting locations are at the top and destinations are at the bottom - i.e. the graph is directed exclusively downward.


   A          E      J       Key:  [Origins]
  / \        / \      \                 \
 B   C      F   L      M             [Destinations]
  \ /  \   /
   K     G
        / \
       H   I

paths = [ ["B", "K"], ["C", "K"], ["E", "L"], ["F", "G"], ["J", "M"], ["E", "F"], ["C", "G"], ["A", "B"], ["A", "C"], ["G", "H"], ["G", "I"] ]

Expected output (unordered):
[ "A": ["K", "H", "I"], "E": ["H", "L", "I"], "J": ["M"] ]

N: Number of pairs in the input.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!