Morgan Stanley Interview Questions
- 16of 16 votes
Answers Given Two array with the preference of two developers say Ying and Ming, both need to create a team according to the preference, you need to return the String containing the Initial of the team the developers got selected it Note: Ying will always got the chance to make a first pick? {{{Example says Ying Preference table [1,2,3,4] and Ming Preference table is [1,2,3,4] than the Output should be 'YMYM' 2nd Example Ying Preference input array [1,3,2] and Ming Preference input array is [3,1,2] than the String return would be 'YYM'. - sam21088 June 22, 2020 in India for PWM| Report Duplicate | Flag | PURGE
Morgan Stanley Java Developer Algorithm - 0of 0 votes
AnswersGiven N number of Strings, generate all combination of these String's characters, these Strings must be N long, and must contain only one number of char from each string.
- sapadt May 04, 2018
example: "abc", "def", "ghi" --> adg, adh, adi, aeg ... cfg| Report Duplicate | Flag | PURGE
Morgan Stanley Software Developer Algorithm - 8of 8 votes
AnswersConsider 10 years down the line we have a mobile device which have 10 TB hard disk.Consider the device a file of 5TB and RAM on the device is 1GB. How will you sort the file of 5TB. You can use extra space but RAM is 1GB which is used by other application on the device also.
- Utsav April 18, 2017 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Senior Software Development Engineer - 0of 0 votes
AnswersWrite a Program in Java, You have an Employee class |
- Utsav April 09, 2017 in India
class Employee{
String name;
Integer id,
Employee manager
}
Each employee has a manager and the manager of CEO is null. Find all direct and indirect reportees of a manager.
Eg. Say Employee e1 reports to CEO,
e2 and e3 reports to e1,
e4 and e5 reports to e2,
e6 reports to e3.
Then by giving e1 as input, output should be e2, e3, e4, e5 and e6.| Report Duplicate | Flag | PURGE
Morgan Stanley Senior Software Development Engineer Java - -3of 3 votes
AnswersC++ Questions
- anony December 23, 2016 in United States| Report Duplicate | Flag | PURGE
Morgan Stanley SDE1 - 0of 0 votes
AnswersDatabase table:
- asdf April 13, 2016 in United States
Name Age Salary Dept
Alice 22 100 IT
Bob 33 150 IT
Charlie 44 180 Operations
Dale 50 200 Finance
What are the apparent problems that you can identify in the database table?| Report Duplicate | Flag | PURGE
Morgan Stanley Associate Database - 1of 1 vote
AnswersMaximize the expression value which consists of numbers and +,- operators. Write a program using Greedy approach in linear complexity and Dynamic approach with O(n3) complexity.
- rahul123jadhaav March 26, 2016 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Software Engineer Intern Coding - 0of 0 votes
AnswersDesign "bookmyshow.com"
- Anand Barnwal August 30, 2015 in India| Report Duplicate | Flag | PURGE
Morgan Stanley design - 1of 1 vote
AnswersYou are given two objects, Student and Course, and there exist a many to many relation between them. One student can be enrolled for more than one course and there can be many students enrolled for a single course. Design an effective data structure to store such data keeping in mind that the time complexity for search should be optimum. A search can be for the list of students enrolled for a single course, or for the list of courses a single student is enrolled.
- angshu1986 May 01, 2015 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Java Developer Data Structures Java - 0of 0 votes
AnswersGiven this set of interfaces:
- freedomsharp April 20, 2015 in United States
public interface Processor<T,U> {
U process(T arg);
}
public interface Splitter<T,V> {
V[] split(T arg);
}
public interface Worker<V,W> {
W processPart(V part);
}
public interface Aggregator<U,W> {
U aggregate(W[] args);
}
and this scenario:
Please provide
1. An implementation of Processor interface
2. Test cases for testing the implementation
http://webcache.googleusercontent.com/search?q=cache:QW8rjNE9dDwJ:stackoverflow.com/questions/29716343/how-to-implement-processort-u-using-java-generics+&cd=1&hl=en&ct=clnk&gl=in| Report Duplicate | Flag | PURGE
Morgan Stanley Associate Coding - 0of 0 votes
AnswersWrite a program that deletes every 5th byte from a file, but without using a temporary file or allocating a buffer in the memory. For adjusting the size of the file you may use the truncate function.
- Anand Barnwal April 07, 2015 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Intern Algorithm - 0of 0 votes
AnswersGiiiven a matrix of -1's and 0's, display a matrix which contains minimum distance to reach nearest 0 for that particular position.
- saran August 08, 2014 in India for Sooftware
Example:
Input: -1 0 -1
-1 -1 -1
-1 -1 -1
Ouutput:
1 0 1
2 1 2
3 2 3| Report Duplicate | Flag | PURGE
Morgan Stanley Software Analyst Algorithm - 1of 1 vote
Answersprint all the binary values of number from 1 to n , each number’s binary should be printed in 0(1).
- gdg July 17, 2014 in India
for eg: n = 6
then print 1 10 11 100 101 110. printing 1, 10 ,11 ,100,101,110 should be in o(1) each| Report Duplicate | Flag | PURGE
Morgan Stanley Sales Development Representative - 0of 0 votes
AnswersGiven the integers from 1 to n, determine how many valid binary heaps can be constructed with these numbers.
- gdg July 17, 2014 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Sales Development Representative - 0of 0 votes
Answersi) Explain Polymorphism
ii) Output of the below code snippet :-
- hulk May 15, 2014 in Indiapublic class ParentTest { public int x = 0; public void print() { System.out.println("In Parent"); } } public class ChildTest extends ParentTest { public int x = 1; public void print() { System.out.println("In Child"); } public static void main( String args[] ) { ParentTest s = new ChildTest(); System.out.println(s.x); s.print(); } }
| Report Duplicate | Flag | PURGE
Morgan Stanley Software Engineer / Developer Java - 1of 1 vote
AnswersGiven three strings str1, str2 and str3; complete the function to find the smallest subsequence in str1 which contains all the characters in str2 (in any order) and not those in str3.
- ankur.emailid April 21, 2014 in India
Sample Test Case:
Sample Input:
str1: spqrstrupvqw
str2: sprt
str3: q
Sample Output: strup
Explanation: In the given string str1, the smallest subsequence that contains the characters in str2 ( 's' , 'p' , 'r' , 't' ) and does not contain the character in str3 ( 'q' ) is 'strup'.| Report Duplicate | Flag | PURGE
Morgan Stanley Java Developer String Manipulation - -1of 1 vote
Answerstypes of index, diff between table and view
- arun.md12 March 04, 2014 in India
stored procedures, slow performance query tuning| Report Duplicate | Flag | PURGE
Morgan Stanley Software Engineer / Developer SQL - -3of 3 votes
AnswerString pool, equals method, create immutable class Person
- arun.md12 March 04, 2014 in India
collection Concurrency, blocked collection, dQueue, multi threading| Report Duplicate | Flag | PURGE
Morgan Stanley Software Engineer / Developer Java - 0of 0 votes
AnswersDesign a game of chess and explain?
- arun.md12 March 04, 2014 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Software Engineer / Developer Algorithm - 0of 0 votes
Answerswhat is the use using 8 GB RAM in Operating System if we can manage a process with 2 GB RAM in 32 bit and 64 bit Operating System.
- premnath.velmurugan February 19, 2014 in United States| Report Duplicate | Flag | PURGE
Morgan Stanley Software Engineer / Developer Operating System - -1of 1 vote
AnswersThere is a string , where a character is missing.Print the missing character.The range is present in the string and the characters are case sensitive.
- write2bikash February 19, 2014 in India
For example:-If input is "baADfc".
Here the range is a to f.
The missing character to be printed is e.
.| Report Duplicate | Flag | PURGE
Morgan Stanley Java Developer Coding - 0of 0 votes
AnswersA typical Change Making problem but a bit twisted. Given a large amount and the denominations given, I need to come up with total number of ways in which the amount can be made using RECURSION. The signature of the function is as follows
- ishan.4525 January 27, 2014 in India
int makeChange(int Amount, int[] Denominations)A
Amount-Total Amount
Denominations- The available denominatins.
It returns total number of ways.. make sure this has to be done Using Recursion..| Report Duplicate | Flag | PURGE
Morgan Stanley Applications Developer Algorithm - 0of 0 votes
AnswersHow to add a more memory dynamically to an array without deleting the old memory, means, expanding an aray without deleting the old one?
- jais.ashish December 05, 2013 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Data Structures - -1of 5 votes
AnswersWrite a comparator which can be used to compare any type of objects?
- java.interviews.questions September 20, 2013 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Java Developer Java - 3of 3 votes
AnswersI need to store countries, its states and cities in a data structure.
- krupaljpatel July 24, 2013 in United States for Risk
The following queries might be used to fetch details
1) find list of states for a country.
2) find list of cities for a state.
3) find the name of the country and state for a city.
eg:
1) India -> Gujarat, UP, MP
MP -> bhopal,indore
Gujarat-> Surat,Ahmedabad, Baroda
2) USA -> Texas, California.. and so on.
Which is the best data structure that can be used to store these details.| Report Duplicate | Flag | PURGE
Morgan Stanley Java Developer Data Structures - 0of 0 votes
AnswersCreate a method which accept a integer as a argument and print on console. This method is accessed by multiple threads. If two or more threads call the method with same value then only one thread should allow to print the value other threads should wait. If values are different then all threads should allow to print the value.
- Prashant Kesarwani May 10, 2013 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Associate Java - 0of 0 votes
AnswersYou have two sorted list A and B.
- xankar April 07, 2013 in United States
A = [1, 3, 4, 6,8,10, 17, 34]
B = [2, 8, 17, 33, 44, 66, 89, 100, 123]
Write a program to print those numbers which are
1) in A and not in B
2) in B and not in A
Eg: After print: 1 , 3 , 4 , 6 , 10, 33, 34, 44,, 66, 89, 100, 123
I was asked to write this in JAVA.| Report Duplicate | Flag | PURGE
Morgan Stanley Senior Software Development Engineer Algorithm Java - 0of 0 votes
AnswersData for various stocks is coming from various stock exchange continuously. Which data structure is suitable to store these data? Later I was told that if stocks are unique means only one data is there for each stock, then which data structure would you be choosing?
- ThanksAll March 30, 2013 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Developer Program Engineer Algorithm - 1of 1 vote
AnswersThere is large set of sorted data where number of data is not known. How could a given number be find efficiently?
- ThanksAll March 30, 2013 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Developer Program Engineer Algorithm