Myntra
Saturn Auto Links Interview Questions and Answers
Q1. print longest substring with k unique values
Find and print the longest substring with k unique characters in an array of strings.
Iterate through the array of strings and keep track of the longest substring with k unique characters.
Use a sliding window approach to efficiently find the longest substring.
Keep a hashmap to store the frequency of characters in the current window.
Update the window boundaries based on the number of unique characters.
Return the longest substring found.
Q2. Find the missing smallest positive integer
Find the missing smallest positive integer in an array of integers
Sort the array to easily identify missing integers
Iterate through the sorted array to find the smallest missing positive integer
Return the missing integer
Q3. print all the subsequences of a string
Generate all possible subsequences of a given string.
Use recursion to generate all possible combinations of characters in the string.
At each step, include or exclude the current character to form subsequences.
Store each subsequence in an array of strings.
Q4. Given an array of 0,1,2, Sort the array
Sort an array of strings containing only 0, 1, and 2.
Use a three-way partitioning algorithm like Dutch National Flag algorithm to sort the array in a single pass.
Keep track of three pointers - low, mid, and high to partition the array into three sections.
Swap elements based on their values to achieve the sorted array.
Q5. Sort colours or the dutch flag problem
The Dutch Flag problem involves sorting an array of strings with three possible values in a specific order.
Create three pointers to keep track of the boundaries of each color group
Iterate through the array and swap elements to group them in the correct order
Time complexity of O(n) can be achieved by a single pass through the array
Q6. longest palindormic substring
A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward.
Use dynamic programming to solve this problem efficiently.
Iterate through the string and expand around each character to find the longest palindrome.
Consider both odd and even length palindromes.
Example: Input 'babad', Output 'aba' or 'bab'.
Q7. rain water problem
The rain water problem involves calculating the amount of rainwater that can be trapped between buildings or structures.
Calculate the maximum height of water that can be trapped at each position
Subtract the height of the building at each position to get the water level
Sum up the water levels at each position to get the total amount of trapped rainwater
Top HR Questions asked in Saturn Auto Links
Interview Process at Saturn Auto Links
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month