I recently appeared for an online assessment test focused on Data Structures and Algorithms (DSA) hosted on the HackerRank platform. The test had a total duration of 110 minutes, during which I was required to solve two challenging DSA problems. Each question was designed to assess my problem-solving skills, understanding of core DSA concepts, and ability to implement efficient algorithms under time constraints. The problems required careful analysis, code optimization, and rigorous testing.
Interview questions [1]
Question 1
1st problem
Problem Statement
You are given an array sequenceData of n positive integers. You may perform the following operation any number of times (including zero):
Choose a prefix of length s (1 ≤ s ≤ n) that contains no zeros.
Subtract 1 from each element in that prefix.
After performing operations in any order, determine the maximum number of zeros that can appear in the array.
2nd problem
You are given two strings:
sourceString: the original string in which you need to search.
pattern: a simplified regex-like pattern that contains exactly one asterisk '*'. The '*' can match any (possibly empty) substring of sourceString.
Your task is to find the length of the longest possible substring in sourceString that:
Starts with the prefix before the '*' in pattern, and
Ends with the suffix after the '*' in pattern,
And the prefix and suffix do not overlap unless the '*' can represent the in-between part (or nothing at all).
If no such match exists, return -1.
I received an Online Assessment (OA) invitation from Amazon. The assessment consisted of two coding questions of medium to hard difficulty, focusing on data structures, algorithms, and problem-solving skills. The questions required efficient solutions with optimized time and space complexity. After the OA, shortlisted candidates typically proceed to one or more technical interview rounds covering coding, system design, and behavioral questions based on Amazon's Leadership Principles.
Applied online via career site, received OA link within 2 days and cleared it, Round 1- DSA, Round-2 DSA, Round 3- System Design, Round 4- Mixed Technical Discussion and Behavioral.
Interview questions [1]
Question 1
Number of Islands (LC 200 - Medium): You are heavily advised to know how to traverse connected components using a 2D grid.
Interview involved one screening OA and one final day, 3 back to back interviews, one technical, one behavioral and one mix. Focused on leader ship principles and DSA and algo