Add office photos
Employer?
Claim Account for FREE

Aristocrat

3.8
based on 246 Reviews
Video summary
Filter interviews by

Mr Cooper Interview Questions and Answers

Updated 29 Jul 2024

Q1. What are you good at in C++ ?

Ans.

I am good at object-oriented programming, data structures, and algorithms in C++.

  • Strong understanding of object-oriented programming principles

  • Proficient in implementing data structures and algorithms in C++

  • Experience with memory management and pointers

  • Familiarity with C++ standard library and STL

  • Ability to optimize code for performance and efficiency

View 1 answer

Q2. What is shallow copy and deep copy ?

Ans.

Shallow copy creates a new object with the same reference as the original, while deep copy creates a new object with a new reference.

  • Shallow copy only copies the top-level object, while deep copy copies all nested objects.

  • Shallow copy is faster and uses less memory, while deep copy is slower and uses more memory.

  • Examples of shallow copy include copying arrays and objects using the spread operator, while examples of deep copy include using JSON.parse(JSON.stringify(obj)) or im...read more

Add your answer

Q3. What is copy constructor ?

Ans.

Copy constructor is a special constructor that creates a new object by copying an existing object.

  • It is used to initialize an object with another object of the same class.

  • It takes a reference to an object of the same class as an argument.

  • It creates a new object with the same values as the object passed as argument.

  • It is automatically called when a new object is created from an existing object.

  • Example: MyClass obj1; MyClass obj2 = obj1; //copy constructor called

Add your answer

Q4. Polymorphism and a function to randomize a pack of cards

Ans.

Polymorphism can be used to create a Card class with different types of cards. A function can then use polymorphism to randomize the pack.

  • Create a Card class with different types of cards as subclasses

  • Implement a function that creates a pack of cards using polymorphism to add different types of cards

  • Use a random number generator to shuffle the pack

Add your answer
Discover Mr Cooper interview dos and don'ts from real experiences

Q5. Implement Merge Sort on an array

Ans.

Implementation of Merge Sort on an array

  • Divide the array into two halves

  • Recursively sort the two halves

  • Merge the sorted halves

  • Time complexity: O(n log n)

  • Space complexity: O(n)

Add your answer

Q6. What are Virtual Functions ?

Ans.

Virtual functions are functions that can be overridden by derived classes.

  • Virtual functions are declared in a base class and can be overridden in derived classes.

  • They allow for polymorphism, where a derived class object can be treated as a base class object.

  • Virtual functions are called based on the actual object type, not the pointer or reference type.

  • They are declared using the virtual keyword in the base class and can be overridden using the override keyword in the derived ...read more

Add your answer

Q7. Standard template library in C++

Ans.

STL in C++ provides reusable algorithms and data structures for efficient programming.

  • STL includes containers like vector, list, map, algorithms like sort, find, and iterators.

  • Example: vector v = {1, 2, 3}; sort(v.begin(), v.end());

  • STL saves time by providing pre-implemented solutions for common programming tasks.

Add your answer

Q8. Design Patterns in C++

Ans.

Design patterns in C++ are reusable solutions to common problems in software design.

  • Design patterns help in creating flexible, maintainable, and scalable code.

  • Examples of design patterns in C++ include Singleton, Factory, Observer, and Strategy.

  • Each design pattern has a specific purpose and can be applied in different scenarios.

  • Understanding design patterns can improve code quality and efficiency in software development.

Add your answer

Q9. Polymorphism in C++

Ans.

Polymorphism in C++ allows objects of different classes to be treated as objects of a common superclass.

  • Polymorphism is achieved through function overloading and virtual functions.

  • Function overloading allows multiple functions with the same name but different parameters.

  • Virtual functions are functions in a base class that are overridden in derived classes.

  • Example: Animal class with virtual function 'makeSound', Cat and Dog classes that override 'makeSound'.

Add your answer
1
2
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Mr Cooper

based on 2 interviews
Interview experience
4.0
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Engineer Interview Questions from Similar Companies

3.7
 • 152 Interview Questions
3.9
 • 41 Interview Questions
3.7
 • 24 Interview Questions
3.4
 • 16 Interview Questions
3.8
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter