Member Technical Staff
200+ Member Technical Staff Interview Questions and Answers

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
Member Technical Staff Interview Questions and Answers for Freshers

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 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 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 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 Adobe

Q. Maximum Sum Problem Statement
You are given an array ARR
of N integers. Your task is to perform operations on this array until it becomes empty, and maximize the sum of selected elements. In each operation, sel...read more
Given an array, select elements to maximize sum by removing adjacent elements.
Iterate through the array and keep track of the count of each element.
Select the element with the highest count first, then remove adjacent elements.
Repeat the process until the array is empty and sum the selected elements.
Share interview questions and help millions of jobseekers 🌟

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

Asked in Goldman Sachs

Q. Regular Expression Match Problem Statement
Given a string str
and a string pat
, where str
may contain wildcard characters '?' and '*'.
If a character is '?', it can be replaced with any single character. If a c...read more
The task is to determine if it is possible to transform a string to match another string using wildcard characters '?' and '*'.
Iterate through both strings simultaneously, handling wildcard characters '?' and '*' accordingly.
Use dynamic programming to keep track of matching subproblems.
Return true if at the end both strings match, false otherwise.

Asked in HashedIn by Deloitte

Q. Detect and Remove Loop in Linked List
For a given singly linked list, identify if a loop exists and remove it, adjusting the linked list in place. Return the modified linked list.
Expected Complexity:
Aim for a...read more
Detect and remove loop in a singly linked list in place with O(n) time complexity and O(1) space complexity.
Use Floyd's Cycle Detection Algorithm to identify the loop in the linked list.
Once the loop is detected, use two pointers to find the start of the loop.
Adjust the pointers to remove the loop and return the modified linked list.

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 Nagarro

Q. Count Ways to Reach the N-th Stair Problem Statement
You are provided with a number of stairs, and initially, you are located at the 0th stair. You need to reach the Nth stair, and you can climb one or two step...read more
The problem involves counting the number of distinct ways to climb N stairs by taking 1 or 2 steps at a time.
Use dynamic programming to solve the problem efficiently.
The number of ways to reach the Nth stair is the sum of the number of ways to reach the (N-1)th stair and the (N-2)th stair.
Handle base cases for N=0 and N=1 separately.
Apply modulo operation to avoid overflow while calculating the result.
Consider using memoization to optimize the solution by storing intermediate...read more

Asked in Adobe

Q. Good Arrays Problem Statement
You are given an array 'A' of length 'N'. You must choose an element from any index in this array and delete it. After deleting the element, you will obtain a new array of length '...read more
Given an array, find the number of 'good' arrays that can be formed by deleting one element.
Iterate through each element in the array and check if deleting it results in a 'good' array
Keep track of the sum of elements at odd and even indices to determine if the array is 'good'
Return the count of 'good' arrays

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. Predecessor and Successor in Binary Search Tree (BST)
Given a binary search tree (BST) with 'N' nodes, find the predecessor and successor of a given 'KEY' node in the BST.
Explanation:
The predecessor of a node...read more
Find predecessor and successor of a given node in a binary search tree (BST).
Predecessor is the node visited just before the given node in an inorder traversal.
Successor is the node visited immediately after the given node in an inorder traversal.
Return -1 if predecessor or successor does not exist.
Implement inorder traversal to find predecessor and successor.

Asked in Zoho

Q. What is a class in js means? And explain its use case
A class in JavaScript is a blueprint for creating objects with similar properties and methods.
Classes are used to create multiple objects with the same structure and behavior.
They provide a way to organize and encapsulate related data and functions.
Classes can have properties (variables) and methods (functions) that define their behavior.
Instances of a class can be created using the 'new' keyword.
Classes can also have constructors, which are special methods called when an obj...read more

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 Adobe

Q. Longest Common Prime Subsequence Problem Statement
Imagine Ninja is tackling a puzzle during his long summer vacation. He has two arrays of integers, each with lengths 'N' and 'M'. Ninja's task is to determine ...read more
Find the length of the longest common prime subsequence between two arrays of integers.
Iterate through both arrays to find prime numbers
Use a set to keep track of common prime numbers
Return the size of the set as the length of the longest common prime subsequence

Asked in Samsung

Q. Stack using Two Queues Problem Statement
Develop a Stack Data Structure to store integer values using two Queues internally.
Your stack implementation should provide these public functions:
Explanation:
1. Cons...read more
Implement a stack using two queues to store integer values with specified functions.
Create a stack class with two queue data members.
Implement push(data), pop(), top(), size(), and isEmpty() functions.
Use one queue for pushing elements and another for temporary storage during operations.
Ensure proper handling of edge cases such as empty stack.
Example: If input is Q = 5, 1 42, 2, 3, 1 17, the output should be 42, -1, 17.

Asked in Dunzo

Q. Convert Array to Min Heap Task
Given an array 'ARR' of integers with 'N' elements, you need to convert it into a min-binary heap.
A min-binary heap is a complete binary tree where each internal node's value is ...read more
Convert the given array into a min-binary heap by modifying the array elements.
Iterate through the array and heapify each node starting from the last non-leaf node to the root node.
For each node, compare it with its children and swap if necessary to satisfy the min-heap property.
Continue this process until the entire array is converted into a min-heap.

Asked in MakeMyTrip

Q. Tower of Hanoi Problem Statement
You have three rods numbered from 1 to 3, and 'N' disks initially stacked on the first rod in increasing order of their sizes (largest disk at the bottom). Your task is to move ...read more
Tower of Hanoi problem where 'N' disks need to be moved to another rod following specific rules in less than 2^N moves.
Implement a recursive function to move disks from one rod to another following the rules.
Use the concept of recursion and backtracking to solve the Tower of Hanoi problem efficiently.
Maintain a count of moves and track the movement of disks in a 2-D array/list.
Ensure that larger disks are not placed on top of smaller disks while moving.
Return the 2-D array/li...read more

Asked in Amazon

Q. Implementing a Priority Queue Using Heap
Ninja has been tasked with implementing a priority queue using a heap data structure. However, he is currently busy preparing for a tournament and has requested your ass...read more
Implement a priority queue using a heap data structure by completing the provided functions.
Implement push() function to insert elements into the queue.
Implement pop() function to remove the largest element from the queue.
Implement getMaxElement() function to return the largest element.
Implement isEmpty() function to check if the queue is empty.

Asked in Hewlett Packard Enterprise

Q. Merge Sort Problem Statement
Given a sequence of numbers ARR
, your task is to return a sorted sequence of ARR
in non-descending order using the merge sort algorithm.
Explanation:
The Merge Sort Algorithm is a D...read more
Implement the merge sort algorithm to sort a given sequence of numbers in non-descending order.
Divide the input array into two halves recursively until each subarray has only one element.
Merge the sorted subarrays back together in non-descending order.
Time complexity of merge sort is O(n log n) and space complexity is O(n).

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 Zoho

Q. When a row in a table is modified, how can you reflect those changes in another related table?
Use triggers to update related table on row modification.
Create a trigger on the main table to update the related table
Use the UPDATE statement in the trigger to modify the related table
Ensure that the trigger is efficient and does not cause performance issues
Test the trigger thoroughly to ensure that it works as expected

Asked in Oracle

Q. Given a social networking graph find the density of a person. Density is how many friends he had interaction with him and the person by the total number of friends for that person
Density of a person in a social networking graph is the ratio of friends who interacted with the person to the total number of friends.
Calculate the number of friends who interacted with the person.
Calculate the total number of friends for that person.
Divide the number of interacting friends by the total number of friends to get the density.
Density = (Number of interacting friends) / (Total number of friends)
Interview Questions of Similar Designations
Interview Experiences of Popular Companies





Top Interview Questions for Member Technical Staff Related Skills

Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary


Reviews
Interviews
Salaries
Users

