Atlassian software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
Question Given a list of people who enter and exit, find the people who entered without their badge and who exited without their badge. This...
Input: ListQuestion Design a Customer Support Ticket System that allows customers to rate support agents on a scale of 1 to 5. You need to implement...
Input: ListQuestion We want to implement a middleware router for our web service, which based on the path returns different strings. This problem is split...
Input: StringQuestion The input is a list of tennis court bookings, where each booking includes a start and end time. You need to write a program that assigns...
Input: ListQuestion Implement a function that formats a list of words into lines, separating them with hyphens, while ensuring no line exceeds a maximum...
Input: Array of stringsDesign Rate Limiter Design a rate limiter system that controls the number of requests allowed within a specified time window. The rate limiter is...
Input: String<timestamp, commodityPrice>. You need to design a data structure that supports upserting...Input: Given inputQuestion Two shuttle buses travel different road networks to reach a festival campsite, picking up passengers at stops along the way. Each bus...
Input: Graph (nodes and edges)Question Design a StorageHierarchyStats class that manages documents organized into labeled buckets. Buckets can have parent-child relationships...
Question Design a PathRouter class that maps URL-like path patterns to handler names. Patterns may contain wildcard segments (*) that match any...
Question You are planning a hiking trip along a trail represented as an elevation array. Snow accumulates or melts on the trail each day according...
Input: ArrayQuestion You are building a simulator for a board game called Rocket Launch. The board has numbered squares from 1 to boardSize. On each...
Question You are given a list of keywords and a text string t. Return the first keyword from the list such that any anagram of that keyword...
Question Design a WormGame class that simulates a worm moving on a 2D grid. The worm starts at the top-left corner (0, 0) with length 1. It...
Question You are given a 1D board represented as an array of instruction strings. You start at index 0. On each step, you follow the instruction at...
Input: ArrayQuestion Design a PlanBilling class that tracks subscription charges on a daily basis and provides monthly and annual billing summaries....
Question You are analyzing race lap data for a set of drivers. Each driver has a list of lap times and a set of laps flagged as pit-stop laps...
Input: ListQuestion A warehouse is organized into sections. Each product belongs to exactly one section. An employee has a pick list of products to collect....
Input: Listnull if none exists. If several pages have the highest score, return the page whose most recent score-changing operation occurred latest. Both increases and decreases count as score-changing operations, including operations that move a page into a tie. Calls execute sequentially, so operation order defines recency without timestamps. Queries and no-op decreases do not change recency. A removed page can later be created again.All three operations must run in expected O(1) time, using O(n) space, where n is the number of currently tracked pages. Do not retain historical records for removed pages or empty score groups.Function or class signaturePopularityTracker() — construct an empty tracker.increasePopularity(pageId: str) -> NonedecreasePopularity(pageId: str) -> NonemostPopular() -> str | None{
"operations": [
["increasePopularity", "ENG-101"],
["increasePopularity", "ENG-202"],
["mostPopular"],
["increasePopularity", "ENG-101"],
["mostPopular"],
["increasePopularity", "ENG-202"],
["mostPopular"],
["decreasePopularity", "ENG-202"],
["mostPopular"]
]
}Output, containing results only for mostPopular calls:["ENG-202", "ENG-101", "ENG-202", "ENG-101"]Explanation: The first query sees both scores at one, and
ENG-202 was updated later. Next, ENG-101 alone has score two. Increasing ENG-202 creates a tie at two that it wins by recency. Decreasing it to one leaves ENG-101 as the unique maximum.Example 2:Input:{
"operations": [
["mostPopular"],
["decreasePopularity", "UNKNOWN"],
["increasePopularity", "RUNBOOK"],
["increasePopularity", "RUNBOOK"],
["increasePopularity", "HANDBOOK"],
["decreasePopularity", "RUNBOOK"],
["mostPopular"],
["decreasePopularity", "RUNBOOK"],
["mostPopular"],
["decreasePopularity", "HANDBOOK"],
["mostPopular"],
["increasePopularity", "RUNBOOK"],
["mostPopular"]
]
}Output:[null, "RUNBOOK", "HANDBOOK", null, "RUNBOOK"]Explanation: The tracker starts empty, and decreasing
UNKNOWN changes nothing. Decreasing RUNBOOK from two to one makes it the most recently updated page in the tie with HANDBOOK. Removing RUNBOOK leaves HANDBOOK; removing HANDBOOK empties the tracker. Creating RUNBOOK again gives it score one.Constraints:200000 method calls are made.pageId is a case-sensitive string of 1 to 64 ASCII letters, digits, hyphens, or underscores.1 and 200000 for tracked pages.topK(k: int) -> list[str], ordered by descending score and then descending update recency. Can you return the result in O(min(k, n)) time without changing the expected O(1) update bounds?text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0. A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. For example, ace is a subsequence of abcde.def longest_common_subsequence(text1: str, text2: str) -> int:text1 = "abcde", text2 = "ace"3text1 = "abc", text2 = "abc"31 <= text1.length, text2.length <= 100text1 and text2 consist of English letters only.nums. Your task is to remove the duplicates in-place such that each element appears only once and returns the new length of the array. Elements beyond the returned length will be ignored. The relative order of the elements should be kept the same.def remove_duplicates(nums: List[int]) -> int:nums = [1, 1, 2] 2 nums array will be modified to [1, 2] and the new length is 2.Example 2: nums = [0, 0, 1, 1, 1, 2, 2, 3, 3, 4] 5 nums array will be modified to [0, 1, 2, 3, 4] and the new length is 5.Constraints: nums is sorted in ascending order.def __init__(self, width: int, height: int): Initializes the game with a specified grid size. def generate_food(self) -> Tuple[int, int]: Generates a food item at a random position on the grid. def move_snake(self, direction: str) -> bool: Moves the snake in the given direction and returns whether the game is still running. def game_over(self) -> bool: Checks if the snake has collided with the wall or itself.Game(width=10, height=10).generate_food() (3, 5) game = Game(10, 10) game.move_snake('right') True 5 and 20. id, a description, and a status (which can be Pending, In Progress, or Completed). Implement the following functions:add_task(id: int, description: str) -> None: Adds a new task with the given id and description.get_task(id: int) -> Tuple[str, str]: Retrieves the task's description and status by id. Returns None if the task does not exist.delete_task(id: int) -> bool: Deletes the task with the specified id. Returns True if the task was deleted successfully, False otherwise.add_task(id: int, description: str) -> None get_task(id: int) -> Tuple[str, str] delete_task(id: int) -> bool add_task(1, "Write unit tests") None get_task(1) ("Write unit tests", "Pending") 1 <= id <= 10^6 description is non-empty and has at most 100 characters 10^5 operations are performed.name, status, and region. You need to implement methods for adding a service, retrieving the status of a service, and listing all services based on a specific status.Function/class signature:def add_service(name: str, status: str, region: str) -> None: def get_service_status(name: str) -> str: def list_services_by_status(status: str) -> List[str]: add_service('Jira', 'active', 'US-East')get_service_status('Jira')'active' Jira was added as active.add_service('Confluence', 'inactive', 'US-West')list_services_by_status('active')['Jira']Jira is listed.def maximum_profit(tasks: List[Tuple[int, int]], total_time: int) -> int:
passExample 1: tasks = [(2, 50), (3, 60), (1, 30)], total_time = 4 80 tasks = [(3, 40), (4, 50), (2, 20)], total_time = 5 50 1 <= len(tasks) <= 100 1 <= duration, profit <= 100 1 <= total_time <= 100 def shortest_path(links: List[Tuple[str, str]], start: str, target: str) -> List[str]:links = [("A", "B"), ("A", "C"), ("B", "D"), ("C", "D"), ("D", "E")], start = "A", target = "E" ["A", "B", "D", "E"] links = [("A", "B"), ("B", "C"), ("C", "D")], start = "A", target = "D" ["A", "B", "C", "D"] 1 <= len(links) <= 1000null when no page has a positive score. Updates must take O(log n) time and this lookup must take O(1), where n is the number of positively scored pages.ConfluencePopularityTracker() — create an empty tracker.increasePopularity(pageId: str) -> int — add one and return the resulting score.decreasePopularity(pageId: str) -> int — subtract one, clamp at zero, and return the resulting score.adjustPopularity(pageId: str, delta: int) -> int — apply a signed adjustment and return the resulting score; adjusting an unknown page by zero or a negative amount leaves it inactive.getMostPopular() -> str | None — return the highest-ranked active page, or null.markViewed(userId: str, pageId: str) -> None — record that the user has viewed the page.getRecommendations(userId: str, k: int) -> list[str] — return at most k unseen page IDs in ranking order; an unknown user has no viewed pages, and k = 0 returns an empty list.[ ["adjustPopularity", "architecture", 5], ["adjustPopularity", "runbook", 5], ["increasePopularity", "onboarding"], ["getMostPopular"], ["markViewed", "alice", "architecture"], ["getRecommendations", "alice", 2], ["decreasePopularity", "architecture"], ["getMostPopular"] ]
[5, 5, 1, "architecture", null, ["runbook", "onboarding"], 4, "runbook"]
[ ["markViewed", "bob", "runbook"], ["adjustPopularity", "runbook", 3], ["adjustPopularity", "runbook", -10], ["getMostPopular"], ["increasePopularity", "runbook"], ["increasePopularity", "architecture"], ["getRecommendations", "bob", 5], ["getRecommendations", "carol", 5], ["getRecommendations", "bob", 0] ]
[null, 3, 0, null, 1, 1, ["architecture"], ["architecture", "runbook"], []]
Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free