Tag: Amazon Interview Questions


Prequesite:- Singly Linked list  Problem :- You are given with an linked list. Write a program to print the odd nodes containing the odd elements followed by the even nodes with even elements. The result should contain a single linked list. The time complexity should be  O(n) where 'n' is ... Read More


Problem Statement: Write an efficient algorithm for matching the pattern given by the user in a string. If the pattern exists print the starting indexes in the string else return 1.   Method 1- Brute Force Approach Lets us look what is problem with the Brute-Force Approach for the string matching Let the length ... Read More


Sliding Window Maximum Algorithm (To track the maximum of each subarray of size k) Problem:- Write an algorithm to track the maximum of each subarray of size k in time complexity O(n) and space complexity O(k),  where n is the size of the array and k is size of the window ... Read More

Contact us

Scroll Up