Atlassian SWE-1 Interview | 75Lakhs CTC | P30 Role
Summary
I interviewed for a SWE-1 role at Atlassian where I was asked two coding problems about finding the longest consistent activity streak, one with no modifications and one allowing a single element change.
Full Experience
Part-1 :-
Atlassian tracks various project activities over time, such as issues created, tasks completed, or deployments made each day.
You are given an array representing the activity recorded on consecutive days.
A consistent activity streak is a contiguous sequence of days where the change in activity between every pair of consecutive days remains the same.
Your task is to determine the maximum length of a contiguous consistent activity streak in the given array.
The streak must contain at least two days.
Part-2 :-
Building on the previous activity-streak problem, suppose Atlassian now allows you to modify at most one day's activity value in the data.
You are given the same array representing activity recorded on consecutive days. You may replace at most one element of the array with any integer you choose, including a negative integer.
A consistent activity streak is a contiguous sequence of days where the change in activity between every pair of consecutive days remains the same.
Your task is to determine the maximum possible length of a contiguous consistent activity streak that can be obtained after replacing at most one element in the original array.
You may choose not to modify the array if the existing data already contains the optimal streak.
Interview Questions (2)
Longest Consistent Activity Streak (No Modification)
Given an array representing daily activity counts, a consistent activity streak is a contiguous sequence of days where the difference between consecutive days is the same. Determine the maximum length of such a streak. The streak must contain at least two days.
Longest Consistent Activity Streak with One Modification
Given the same array, you may change at most one element to any integer (including negative). A consistent activity streak is defined as before. Find the maximum possible length of a contiguous consistent activity streak after at most one modification. You may also choose not to modify the array.