Adobe
20+ Vailankanni Public School Interview Questions and Answers
You are given an array “ARR” of N integers. You are required to perform an operation on the array each time until it becomes empty. The operation is to select an element from the array(let’s say at i...read more
You have been given a number of stairs. Initially, you are at the 0th stair, and you need to reach the Nth stair. Each time you can either climb one step or two steps. You are...read more
Given a singly linked list, you have to detect the loop and remove the loop from the linked list, if present. You have to make changes in the given linked list itself and return the update...read more
Implement a Stack Data Structure specifically to store integer data using two Queues.
There should be two data members, both being Queues to store the data internally. You may use the inbuilt Q...read more
You are given an array ‘A’ of length ‘N’, you have to choose an element from any index in this array and delete it. After deleting the element you will get a new array of length ‘N’-1. Your task is t...read more
You have been given a binary search tree of integers with ‘N’ nodes. You are also given 'KEY' which represents data of a node of this tree. Your task is to find the predecessor a...read more
Ninja got a very long summer vacation. Being very bored and tired about it, he indulges himself in solving some puzzles.
He encountered a problem in which he was given two arrays...read more
Q8. Suppose there is an unsorted array. What will be the maximum window size, such that when u sort that window size, the whole array becomes sorted. Eg, 1 2 6 5 4 3 7 . Ans: 4 (6 5 4 3)
Find the maximum window size to sort an unsorted array.
Identify the longest decreasing subarray from the beginning and longest increasing subarray from the end
Find the minimum and maximum element in the identified subarrays
Expand the identified subarrays until all elements in the array are covered
The length of the expanded subarray is the maximum window size
Q9. What is merge sort and Quick sort. Adv and Disadv of each and which one would u use to sort huge list and Y
Merge sort and Quick sort are sorting algorithms used to sort arrays of data.
Merge sort is a divide and conquer algorithm that divides the input array into two halves, sorts each half recursively, and then merges the sorted halves.
Quick sort is also a divide and conquer algorithm that selects a pivot element and partitions the array around the pivot, sorting the two resulting sub-arrays recursively.
Merge sort has a time complexity of O(n log n) and is stable, but requires add...read more
Q10. Puzzle: There is a grid of soldier standing. Soldier ‘A’ is chosen: The tallest men from every column and the shortest among them. Soldier ‘B’ is chosen: The shortest men from every row and the tallest among th...
read moreComparison of heights of two soldiers chosen based on different criteria from a grid of soldiers.
Soldier A is chosen based on tallest men from every column and shortest among them.
Soldier B is chosen based on shortest men from every row and tallest among them.
The height of Soldier A and Soldier B cannot be determined without additional information about the grid of soldiers.
Q11. How to find a loop in a Linked List and how to remove it
To find and remove a loop in a Linked List, we can use Floyd's Cycle Detection Algorithm.
Use two pointers, slow and fast, to detect if there is a loop in the Linked List
If the two pointers meet at some point, there is a loop
To remove the loop, set one of the pointers to the head of the Linked List and move both pointers one step at a time until they meet again
The meeting point is the start of the loop, set the next pointer of this node to NULL to remove the loop
Q12. How to find longest last occurring word in a sentence with multiple whitespace
Finding the longest last occurring word in a sentence with multiple whitespace.
Split the sentence into words using whitespace as delimiter
Reverse the list of words
Iterate through the list and find the first occurrence of each word
Calculate the length of each last occurring word
Return the longest last occurring word
Q13. What’s priority queue. How will u make stack and queue with priority queue
Priority queue is a data structure that stores elements with priority levels and retrieves them in order of priority.
Priority queue is implemented using a heap data structure.
Stack can be implemented using a priority queue by assigning higher priority to the most recently added element.
Queue can be implemented using a priority queue by assigning higher priority to the oldest element.
What is Vtable and VPTR in C++?
Q15. Solve and code the problem of a ball falling from staircase. Each jump can be of 1 step or 2. Find the number of combination of reaching step N
Code to find number of combinations of reaching step N by ball falling from staircase with 1 or 2 steps per jump.
Use dynamic programming to solve the problem
Create an array to store the number of ways to reach each step
Initialize the array with base cases for steps 0, 1, and 2
Use a loop to fill in the array for steps 3 to N
The number of ways to reach step i is the sum of the number of ways to reach step i-1 and i-2
Return the value at the Nth index of the array
What is Memory Protection in OS ?
Q17. What happens when an recursive function is called
A recursive function calls itself until a base case is reached, then returns the result to the previous call.
Each call creates a new instance of the function on the call stack
The function continues to call itself until a base case is reached
Once the base case is reached, the function returns the result to the previous call
The previous call then continues executing from where it left off
What Friend Functions in C++?
Q19. Define Process &thread
Process is an instance of a program while thread is a subset of a process that can run concurrently with other threads.
A process is a program in execution
A process can have multiple threads
Threads share the same memory space as the process
Threads can run concurrently with other threads within the same process
Examples of processes include web browsers, word processors, and media players
Examples of threads include GUI thread, network thread, and background thread
Q20. Implement stack using queue
Implementing stack using queue involves using two queues to simulate stack behavior.
Create two queues, q1 and q2.
Push operation: Enqueue the element to q1.
Pop operation: Dequeue all elements from q1 to q2 except the last element. Dequeue and return the last element.
Swap the names of q1 and q2 after each pop operation.
Top operation: Return the last element of q1 without dequeuing it.
isEmpty operation: Check if both q1 and q2 are empty.
More about working at Adobe
Interview Process at Vailankanni Public School
Top Member Technical Staff Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month