Member Technical Staff
30+ Member Technical Staff Interview Questions and Answers for Freshers

Asked in Amazon

Q. Next Smallest Palindrome Problem Statement
Find the next smallest palindrome strictly greater than a given number 'N' represented as a string 'S'.
Explanation:
You are given a number in string format, and your ...read more
Find the next smallest palindrome greater than a given number represented as a string.
Iterate from the middle of the number and mirror the left side to the right side to create a palindrome
If the resulting palindrome is greater than the input number, return it
Handle cases where the number has all 9s and requires a carry over to the left side

Asked in DE Shaw

Q. Buy and Sell Stock Problem Statement
Imagine you are Harshad Mehta's friend, and you have been given the stock prices of a particular company for the next 'N' days. You can perform up to two buy-and-sell transa...read more
The task is to determine the maximum profit that can be achieved by performing up to two buy-and-sell transactions on a given set of stock prices.
Iterate through the array of stock prices to find the maximum profit that can be achieved by buying and selling stocks at different points.
Keep track of the maximum profit that can be achieved by considering all possible combinations of buy and sell transactions.
Ensure that you sell the stock before buying again to adhere to the con...read more

Asked in VMware Software

Q. Check Permutation Problem Statement
Given two strings 'STR1' and 'STR2', determine if they are anagrams of each other.
Explanation:
Two strings are considered to be anagrams if they contain the same characters,...read more
Check if two strings are anagrams of each other by comparing their characters.
Create a character frequency map for both strings and compare them.
Sort both strings and compare if they are equal.
Use a hash set to store characters from one string and remove them while iterating through the other string.
Check if the character counts of both strings are equal.
Example: For input 'listen' and 'silent', the output should be true.

Asked in Salesforce

Q. Longest Happy String Problem Statement
Given three non-negative integers X
, Y
, and Z
, determine the longest happy string. A happy string is defined as a string that contains only the letters 'a', 'b', and 'c' w...read more
The longest happy string problem involves constructing a string with 'a', 'b', and 'c' without having any three consecutive letters being the same.
Determine the maximum number of times 'a', 'b', and 'c' can appear in the string based on the given input values.
Construct the longest happy string by alternating between 'a', 'b', and 'c' while respecting the constraints.
Return '1' if a correct happy string can be formed, otherwise return '0'.

Asked in LinkedIn

Q. Optimal Strategy for a Coin Game
You are playing a coin game with your friend Ninjax. There are N
coins placed in a straight line.
Here are the rules of the game:
1. Each coin has a value associated with it.
2....read more
The problem involves finding the optimal strategy to accumulate the maximum amount in a coin game with specific rules.
Start by considering the base cases where there are only 1 or 2 coins.
Use dynamic programming to keep track of the maximum amount that can be won at each step.
Consider the different scenarios when choosing a coin from either end of the line.
Keep track of the total winnings for both players and choose the optimal strategy to maximize your winnings.
Implement a r...read more

Asked in Microsoft Corporation

Q. Spiral Matrix Problem Statement
You are given a N x M
matrix of integers. Your task is to return the spiral path of the matrix elements.
Input
The first line contains an integer 'T' which denotes the number of ...read more
The task is to return the spiral path of elements in a given matrix.
Iterate through the matrix in a spiral path by keeping track of boundaries.
Print elements in the order of top row, right column, bottom row, and left column.
Continue the spiral path until all elements are printed.
Member Technical Staff Jobs




Asked in BNY

Q. Cycle Detection in a Singly Linked List
Determine if a given singly linked list of integers forms a cycle or not.
A cycle in a linked list occurs when a node's next
points back to a previous node in the list. T...read more
Detect if a singly linked list forms a cycle by checking if a node's next pointer points back to a previous node.
Traverse the linked list using two pointers, one moving one step at a time and the other moving two steps at a time.
If the two pointers meet at any point, there is a cycle in the linked list.
Use Floyd's Cycle Detection Algorithm for efficient detection of cycles in linked lists.

Asked in VMware Software

Use a stack data structure for implementing undo and redo operations.
Stack data structure is ideal for implementing undo and redo operations as it follows Last In First Out (LIFO) principle.
Push the state of the system onto the stack when an action is performed, allowing for easy undo by popping the top element.
Redo operation can be implemented by keeping a separate stack for redo actions.
Example: In a text editor, each change in text can be pushed onto the stack for undo and...read more
Share interview questions and help millions of jobseekers 🌟

Asked in BlueStacks

Q. Move Zeroes to End
Given an unsorted array of integers, adjust the array such that all zeroes are moved to the end while preserving the order of non-zero elements.
Input:
The input provided consists of multiple...read more
Move all zeroes in an unsorted array to the end while preserving the order of non-zero elements.
Iterate through the array and maintain two pointers - one for the current position and one for the position to swap with.
If the current element is non-zero, swap it with the element at the swap pointer and increment the swap pointer.
After iterating through the array, fill the remaining positions with zeroes.
Example: Input: [0, 1, -2, 3, 4, 0, 5, -27, 9, 0], Output: [1, -2, 3, 4, 5,...read more

Asked in Salesforce

Q. Minimum Swaps to Sort Array Problem Statement
Given an array arr
of size N
, determine the minimum number of swaps required to sort the array in ascending order. The array consists of distinct elements only.
Exa...read more
The minimum number of swaps required to sort an array of distinct elements in ascending order.
Use a hashmap to store the index of each element in the array.
Iterate through the array and swap elements to their correct positions.
Count the number of swaps needed to sort the array.

Asked in Adobe

Q. Given an unsorted array, what is the maximum window size such that sorting that window will result in the entire array being sorted? For example, given the array [1, 2, 6, 5, 4, 3, 7], the answer is 4 (the wind...
read moreFind 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

Asked in VMware Software

Yes, I can design the bank architecture using basic OOP concepts in any programming language.
Create classes for entities like Bank, Account, Customer, Transaction, etc.
Use inheritance to model relationships between entities (e.g. SavingsAccount and CheckingAccount inheriting from Account).
Implement encapsulation to hide internal details of classes and provide public interfaces for interaction.
Utilize polymorphism to allow different classes to be treated as instances of a comm...read more

Asked in Adobe

Q. 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

Asked in Adobe

Q. Puzzle: There is a grid of soldiers 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 t...
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.

Asked in Adobe

Q. How do you find a loop in a Linked List and how do you 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

Asked in Adobe

Q. How do you find the longest last occurring word in a sentence with multiple whitespaces?
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

Asked in Adobe

Q. 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.

Asked in Adobe

Q. A ball is falling from a staircase. Each jump can be of 1 step or 2. Find the number of combinations to reach step N. Solve and code this problem.
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

Asked in Zoho

Q. Find the waiting time of each person in a hospital scenario, focusing on OOP concepts.
Calculate the waiting time for each patient in a hospital based on their arrival and service times.
Define a Patient class with attributes: arrivalTime, serviceTime, and waitingTime.
Use a list to store multiple Patient objects representing each person in the queue.
Sort the patients based on arrival time to simulate the order of service.
Calculate waiting time for each patient as: waitingTime = totalServiceTime - arrivalTime.
Example: If Patient A arrives at 2 PM and is served at...read more

Asked in Adobe

Q. What happens when a 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

Asked in CCTech

Q. A horse is tied to a corner of a square with sides of 5 cm using a 15m rope. Calculate the grazing area.
The grazing area of the horse can be calculated by finding the area of the circle formed by the rope.
Calculate the radius of the circle formed by the rope (15m).
Use the formula for the area of a circle (A = πr^2) to find the grazing area.
Subtract the area of the square (5cm x 5cm) from the grazing area to get the final result.

Asked in CCTech

Q. Which is greater, 1+√2 or √5? Explain graphically.
1+√2 is greater than √5 graphically.
Plot the points on a number line or graph.
1+√2 is approximately 2.41, while √5 is approximately 2.24.
Therefore, 1+√2 is greater than √5.

Asked in Metric Stream Infotech

Q. How would you develop and implement security and cloud controls for Cloud Engineering?
Develop and implement security and cloud controls for Cloud Engineering
Conduct a thorough risk assessment to identify potential security threats
Implement encryption protocols to protect data in transit and at rest
Utilize multi-factor authentication to enhance access control
Regularly monitor and audit cloud infrastructure for security vulnerabilities
Implement automated security controls to quickly respond to threats
Train employees on security best practices to prevent human er...read more

Asked in BYJU'S

Q. Given an array of integers, find the maximum number of distinct elements in every sliding window of size k.
Find maximum distinct elements in every sliding window of size k.
Create a hash table to store the frequency of each element in the current window.
Use two pointers to maintain the current window and slide it over the array.
Update the hash table for each new element in the window and remove the old element.
Keep track of the maximum number of distinct elements seen so far.
Repeat until all windows of size k have been processed.

Asked in Adobe

Q. Define process and 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
Asked in Vidyuttech Services

Q. Implement a stack using queues.
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.

Asked in GeeksForGeeks

Q. Given a string, find the minimum number of swaps required to make it a palindrome. If it is not possible to make it a palindrome, return -1.
Minimum number of swaps required to make a given array of strings a palindrome.
Create a hash table to store the frequency of each character in the array.
Iterate through the array and count the number of characters with odd frequency.
If the count is greater than 1, the array cannot be rearranged into a palindrome.
Otherwise, use two pointers to swap characters and count the number of swaps required to make the array a palindrome.

Asked in Zoho

Q. Coding in machine with complex problemns
Coding in machine with complex problems requires strong problem-solving skills and knowledge of algorithms.
Understand the problem thoroughly before starting to code
Break down the problem into smaller subproblems
Use appropriate data structures and algorithms to solve the problem efficiently
Test your code thoroughly to ensure it works correctly
Optimize your code for performance if necessary

Asked in BYJU'S

Q. Given a Binary Search Tree (BST), find the 4th smallest element in it.
Find the 4th smallest element in a Binary Search Tree.
Traverse the BST in-order and keep track of the count of visited nodes.
When the count reaches 4, return the current node's value.
If the BST has less than 4 nodes, return null or throw an exception.

Asked in Model N

Q. Java program on data structures
Java program on data structures
Use Java to implement common data structures like arrays, linked lists, stacks, queues, trees, and graphs
Practice implementing algorithms like sorting, searching, and traversal on these data structures
Understand the time and space complexity of different operations on data structures
Interview Questions of Similar Designations
Interview Experiences of Popular Companies





Top Interview Questions for Member Technical Staff Related Skills



Reviews
Interviews
Salaries
Users

