Pramod Singh

Pramod Singh

  • 1.3k
  • 389
  • 31.7k

C# Object Oriented Programming

Mar 12 2019 1:06 AM
Hi Team,
 
Need your help regarding below Qns.

1. In a simple singleton implementation, we create private constructor and provide static function for checking the existence of the instance and return the new or existing instance accordingly. Under this implementation, how to create the 2nd instance of a singleton object without changing the implementation of the original source?

2. Please describe a solution on how we can have different implementations of algorithms on the same functionalities and provide the flexibility of using the new implementation that will be developed later without changing existing codes and recompiling the whole application. 

3. Briefly explain what is a deep clone and a shallow clone and the reason for implementing the deep clone.

4. In C#/JAVA, how do we do inter-processes communication and what are the pros and cons for the mechanism suggested?

5. In a multi-threaded application, we start multiple threads. We allow the threads to execute in a random order except in one of the function calls, we need to ensure the execution sequence. How to do it in C#/JAVA ?. 

Thanks
Pramod Singh 

Answers (2)