Saturday, February 24, 2018

Software Architect Interview with AntWorks

1) What is delegate and how do you make two subscribers of event call parallel? i.e If they called sequentially there would be chance that event maintained data could be accessed/modified by one other and other might get data integration issue.

2) How reflection is implemented in C#?

3) What is the default parameter in C++/C# ?

4) Let's say you have Method1 in class A and fields like x, y. If you create multiple instances of A, how much memory Method1 consume?
class A{
int x;
int y;
Method1(){...}
}
If it consumes only single code memory then how this method know the value of members x, y of A?

5) What is the use of 64-bit processors than 32 bit ones?

6) Let's say, you have list updated by thread getting data from some driver. When ever there is change in list then you need to notify the interested people. Write a code for this.

7) How to share data among multiple process where data size is huge?

8) Can I share data using Dlls? If yes then data could be red by unwanted processes right??


Thursday, February 22, 2018

Difference between Various Parse in C#

C# supports 3 supported Parse function:
1) int.Parse(stringTobeParsed...);
2) int.TryParse (stringTobeParsed, out intVariableToCatchResult) : int
3) Convert.ToInt(...)


Out of these 3, the most preferred one is 2nd one i.e TryParse which doesn't throw exceptions like other 2 and based on it's return value, one can understand whether conversion is success or not. i.e we should process the out value only when this function returns true. When exception stuff exist in input params, it returns false.


Reference:


https://www.codeproject.com/Tips/845439/Difference-between-int-Parse-Convert-ToInt-and-int