Showing posts with label Interview. Show all posts
Showing posts with label Interview. Show all posts

Monday, June 11, 2018

Interview

1. Write synchronous and asynchronous code in only javascript.
A
ns : Synchronous code
console.log('1');
console.log('2');
console.log('3')
Asynchronous code
console.log('1')
setTimeout(function afterTwoSeconds() {
console.log('2')
}, 2000)
console.log('3')

2. What is typescript
Ans : TypeScript is an open-source language which builds on JavaScript.

 
3. What is transpilation
Ans : Transpilers, or source-to-source compilers, are tools that read source code written in one programming language, and produce the equivalent code in another language.

4. In test.js we have written console.log("Hello"); Now i have changed the test.js to test.ts. Is that print "Hello". there is no node js is installed. How can we print "Hello" without using any IDE like VS Code, Visiual Studio.

Ans : TypeScript is its own thing which isn't tied to any framework/library. You can use it with regular JS, other frameworks like React, etc. You can even use it on the server-side with Node.
Then, install TypeScript globally by running this in your terminal:
$ npm install -g typescript
Then, all you have to do is create a TypeScript file like script.ts and write TypeScript inside of it. When you want to compile it, just run this in your command line:
$ tsc script.ts
If you're working on a larger project with multiple TS files, it helps to set a TypeScript configuration file to handle how TypeScript works with your project. You can do so by running:
$ tsc --init
This will automatically create a tsconfig.json file for you which will allow you to start using TypeScript in your project. To compile the entire project, you just need to run:
$ tsc

5. Which version of node js is using.
6. Suppose there are version 9.4.3, 8.2.1, 7.4.6, and you are using 5.2.1..then which version you will upgrade yourself.
Ans : Last stable version (LTS)

7. In version x.y.z  what is the meaning of x, y ,z.
Ans : Major Minor Build
 
8. Write promise code.
Ans : var promise = new Promise(resolve,reject){
resolve(10);
}

9. How to start Node Js application from scratch.
Ans : 1. npm init (this will create package.json) 2. npm install express ( for require module you have required express)

 
10. Supoose you have a folder name "yourproject" in any drive. and you run npm start, what depencies it will download or what it will do.

11. What is package.json
Ans : https://interview-preparation-for-you.blogspot.com/2018/12/what-is-use-of-packagejson.html

12. If i removed package.json, then what will be happen.

13. What information package.json have.
Ans : https://interview-preparation-for-you.blogspot.com/2018/12/what-is-use-of-packagejson.html

14. If i deployed a project in deployment server and i remove the package.json. Then what will be happen.
15. If nothing is happen after removing the packegae.json what will the future impact.
16. Which version of express i am using.
17. What is export keyword. what is does.
18. suppose we have two scenarion like below
A) Export class One
{
//something...
}
B) Export class One(same name)
{
//something
}
Is there is any clash in name, because we are using same name.
If not how the Node JS handle this
19. What is my project architecture
20. Explain ICP2 
21. Which stream i am using
22. What are the different stream avalable in Node JS
23. What are Module used in project
24. Overloading in express like app.use('myName', handler) and app.use(sender)...difference between them.
25. What is PM2.
26. How to run application using PM2.
27. Whice module are using for MongoDb.
28. What is diferent between ('mongodb').MongoClient and Mongoose
29. How to handle if the connection is broken with node js application
30. Which version of mongodb is using
31. How it is difference from SQL server or any other traditinal database
32. what are others NoSql DB, like redish or any other he was asking i forgot name.
33. How you will choose the technology for building the Application like C#, MVC or Node Js
34. Why you have choosen MongoDB.
35. What is AWS and how to use it.
36. How Node JS handle the Multiple request and how c# handle the multiple request.
38. HMO(High availablity in mongoDB). Means replica set. Master Slave working of MongoDb
39. LibUV

Friday, August 4, 2017

Managerial Round

What is your greatest strength?
What is your biggest strength?
What strengths would you bring to our company?
What are three strengths that you bring to this position?
What are your greatest professional strengths?
What is your greatest accomplishment or the project you’re most proud of completing? 
What do you do best in your current position? 
What would your co-workers say is your strongest area of expertise?
Positive
Optimistic
Work Under Pressure
Passionate about learning new things
Pay a lot of attention on details
Good Team Player
Goal oriented
Self Motivated
Negative
I Seek perfection while doing work which is not possible sometimes.
I find it difficult to say no who ask for help.
I am workaholic. If I am into work, I never bother about time because I want my work to be finished as soon as possible.
Where do you see yourself five years from now?
I definitely see my self employed within this company for the next 5 years and beyond. I feel my self with more knowledge and better skills at senior position while taking more responsibility and contributing growth of the company.
A valued employee of my company.

What are your short term and long term goals?
I have learned that long-term goals are best achieved when I break them into shorter goals.
My short term goal is to serve for my company by using my knowledge and skills and long term goal is create an identity for myself in my company.
OR
My goal is to always perform at an exceptional level. But a short term goal I have set for myself is to implement a process that increases work efficiency.

My short term goal is I want such a platform where I can grow my career along with the organisation growth and my long term goal is to get a respectable position in your company and become an essential part of it.

What are three positive character traits you don't have?
Ability to socialize with anyone.
Being able to speak to an audience. I absolutely hate speaking to crowds.
Name three positive traits you already have.
User Submitted Interview Answers
1. One is my sense of humor, two is that I am good I am a people's person, three is I m always happy.   
2. Optimistic, positive, and excited.   
3. Confidence in speaking to the public, prioritization of tasks, decision making.   
4. Natural leader, reliable, highly motivated.   
5. Retail and HR management.   
6. Listening, communication, and easy going.   
7. I am very optimistic, I am organized, and driven.   
8. My work ethic, my sense of humor, and my leadership abilities.   
9. I believe there is always room to grow and better your personal traits. I would say problem solving, project managing, and root cause analysis. I have all these traits but there is always more learning.    
10. Strong work ethic team player proactive.
How would you gain your team's trust?
Tell me about a time when you have helped resolve a dispute between others.
How would you describe your work style?

Friday, May 27, 2011

Interview Questions H.. 12

1)Write a query to get the fifth higest salary froma table.
Ans. Select min(custkey) from (Select top 5 * from Customers order by custkey desc) as topfive

2) Difference between Class and object.
Ans. Class is a collection of functions and data(variables) while object is away to access those functions and variable.

3) What are the different properties of OOPS?
1) Encapsulation 2) Inheritance 3) Polymorphism 4) Abstraction

4) Trigger on Log on
Ans. Yes we can create Log On Trigger in SQL 2005. It will fire whenever any one will login. But there some problem I have notice it is doing multiple entries for one login, 3 for me.

5) Trigger on ddl.
Ans. Yes we can create Trigger on DDL in SQL 2005.

6) Which one is saved in memory object or class?
Ans. Please let me know if you find the answer.

7) What is serialization? And why we use it?
Ans. To save the state of object in a form that can be save in memory or transfer through wire.It is called serialization. We use this in games to save the intermediate state of game or any other place where is required.

8) What is Reflection?
Ans. Reflection is used to call an assembly or class functions dynamically. Or to access any other information from assembly.

9) What is Singleton Patter?
Ans. Single Pattern to strict the creation of object ( only one object). This can be achieved using private constructor. Singlton

10) What other design pattern you know?
Ans. 1) Iterator Pattern 2)Abstract Factory 3) Factory Pattern.4) Prototype Pattern
Patterns

11) C# is case sensitive ?
Ans. Yes

12) VB.Net is case sensitive ?
Ans. No

13) Join
Ans. Click here

14) Garbage Collection.
Ans. Click here for detailed explanation

15) Difference between hiding and overriding.
1) When you want a same name function in child class without overriding than you can hide the function. Hide function is completely new function for child there is no relation of this method to base class. Both methods signature can be different.
2)For Hiding we use new keyword while for overriding we use override keyword. Hiding is also applicable by default.
3)If you have assigned child class reference to base class variable it shows different behavior for hiding and overriding. In hiding it will call base class method while in case of overriding it will call child class method.

Friday, May 20, 2011

Interview Questions N- 11

1) Difference between Truncate and Delete.

2) Difference between obj1.equal(obj2) and obj1==obj2

3) Webservice is stateless or stateful?

4) How can we maintain state in webservice?

5) Difference between function and procedure

6) Difference between abstract and interface.

7) Can we declare public variables in interface?
Ans: No, access specifier not allowed in interface. Although only function are allowed in interface not variable.

8)What is virtual function?

9) Which type of VB.Net is equalent to Variant of VB?
Ans : Object

10) Which method is equalant to C# destructor in VB .Net?
Ans : Finalizers

11) Which type of exception a web service can throw?
Ans : Fault Exception

12) Range Validator Support which type?
Ans :
Currency
Date
Double
Integer
String


13) What will be the effect of ApplydefaultSort=true in a dataset?
Ans : If true, the DataView sets a sort order to ascend based on the primary key column of the underlying DataTable. If set to false, this property has no effect. The ApplyDefaultSort property is ignored if the DataView.Sort property isn’t a null reference or an empty string. ApplyDefaultSort also has no effect if the underlying DataTable doesn’t have a primary key defined.

14) Which method used for determine dataset changes?
Ans : HasChanges()

15) Integer datatype represent which one
a) Int32 b) Int64 c) Int16
Ans : Int32

16) How will you use switches in webservice?

17) How will you trace a page in web application?

18) How will you implement roll based security in ASP .Net

19) What is boxing?
a) Encapsulate a value into object
b) Encapsulate a copy of value into object

Ans : Boxing is the process of converting a value type to the type object

20) What is difference between Byval and ByRef.

21) What is scope identity?
Ans : Give the last identity used in a function or procedure.

22) Write a query to get highest salary from employee table.

Ans : Select Top 1 Salary from Employee.

23) What is dll hell problem?
Most beautiful answer of this question was : Ma'am I have searched a lot on google but did not find any answer.

And that guy was selected.

24) How will you get any value from resource file?
Ans :
ResourceManager.GetString or ResourceManager.GetStream, depending on the type of the resource
Ex

string resourceFile = file;

string filePath = System.AppDomain.CurrentDomain.BaseDirectory.ToString();

ResourceManager resourceManager = ResourceManager.CreateFileBasedResourceManager(resourceFile, filePath, null);
// retrieve the value of the specified key
resourceValue = resourceManager.GetString(key);

Another way is using namespace

Namespace.Properties.Resources.FileName

Ex.
i.e.: TestProject1.Properties.Resources.MyXmlFile -> direct access to the File in the resources

25) When you deploy an ASP .Net application which files copy on production server?
Ans : Deploying an ASP.NET web application entails copying the ASP.NET-related files from the development environment to the production environment. The ASP.NET-related files include ASP.NET web page markup and code and client- and server-side support files. Client-side support files are those files referenced by your web pages and sent directly to the browser - images, CSS files and JavaScript files, for example. Server-side support files include those that are used to process a request on the server-side. This includes configuration files, web services, class files, Typed DataSets, and LINQ to SQL files, among others.

In general, all client-side support files should be copied from the development environment to the production environment, but what server-side support files get copied depends on whether you are explicitly compiling the server-side code into an assembly (a .dll file) or if you are having these assemblies auto-generated.

26) What is the type of web config file?
a) Dll b) Xml c) Resource
Ans : Xml

27) What is the use of @ when you use it before string value?
Ans: Used as escape character for backslash

28) Why we use Monitor object?
Ans : Monitor object are used to ensure that a block of code runs without interruption of other thread. This is a way of synchronization, code from other thread can not run until code written in synch block has finished.

29) Can we update ,delete or insert in a function?
Ans : Can write but such a function can not called will throw error.

30)Can we perform Select in function?
Ans : Yes

31) How can we overload methods in web service?
Ans: Using Message Name attribute

32) What is the use of MessageName, Duration in web service?
Ans : used for overloading

33) How can we override methods in web service?

Friday, May 13, 2011

Interview Questions NGR- 10

1) What is ManualReset event?
Ans : They are used to signal and non signal the waiting thread.


2) What is the use of dispose method?

3) What is connection pooling?

4) What is dipatcher?

5) Join Difference between eque join and self join?

6) Can we write return statement inside finally?
Ans : No

7) What is the use of background worker component?

8) What is Garbage Collection?

9) What us gen0, gen1, gen2?

10) Can we have destructor in C#?
Ans : Yes
11) All questions from Threading and Garbage Collection

12) If we have same method in two interfaces and we implement the same with them than how will you define that method in the class and how you will call that method?

13)If we written return statement in catch block will control go in finally ?
 Ans : yes

14) Where we use bubbling give me real scenario?
Ans : Gmail

Friday, May 6, 2011

Interview Questions Inoday - 9

1) What is job scheduling?

2) Why we use view state?

3) What is the difference between two textboxes if one has multiline true and other has false. And max length for both is 10?

4) Can we move view state tag from above to below of the page on Render event to help in SEO?

5) What is the difference between Arraylist and Arrays?

6) What is assembly?

7) What is dll?

Friday, April 29, 2011

Interview Questions IG - 8

1) What is Json?

2) Why we use Json?

3) Joins - Left Outer, Right Outer, Full Outer, Inner Join?

4) Why we use static method?

5) Give me real example where you use static method.

6) If we have a table in which thousands of record inserting,deleting and updating daily. Which tyhpe of index you will use there.

7)Any critical job/work that you have done so far?

8) Difference between clustered and non clustered index.

9) What is identity?

10) What is scope identity?

11) Is it make sense that we define clustered index on primary key column.
Ans : No, not required already clustered index created on primary key

12) Can we define clustered index on composite column?
Ans : yes

Friday, April 22, 2011

Interview Questions MMT -7

1) Difference between WebFarm and WebGarden.

2) Session is best in WebGarden Scenario?

2) Three differences between PrimaryKey and UniqueKey.

Answer. 1. Primary key is only one in table while unique key can be multiple
2. unique key can be null
3. cluster index create on primary key while non cluster index can be created on non cluster index.

3)What is Currency Control?

4) Where we use Currency Control?
a) Forms b) Control c) Both d) None

5)What is the use of Server.Execute?

6) Default in web.config file.
Answer : Anonymous access

7)Do we need to stop IIS before installing new version of an assembly?

8)Which file is used to define Resource Info ?
a) Web.config b) Global.asax c) Both d) None

9)If you want to get Forms Collection what will you use?
a) Response.Redirec b) Server.Transfer c) Server.Execute d) None e) All

10)Thread is a
a) Event b) Object c) Instance Method d) Static Method

11)Which can not be new?
a) DataReader b)DataTable c) DataRow d) DataColumn

12)How will you bind a text box with dataview?
a) Text1.Databinding(dv,"EmpNo")
b) Text1.Databinding(dv)
c) Text1.Databinding("EmpNo")
d) None

13)Which is wrong?
a) You can find data in dataview if dataview is sort only.
b) Dataview is a subset of rows and columns.
c) None
d) Both

14) ConnectionPool access in case of
a) Connection Close b) Connection Dispose c) Connection Life time expired d) All

15) Pessimistic lock used when
a) High Contention
b) Lock cost is low than Rollback
c) Lock cost is high than Rollback
d) All
e) None

16)Session objects are accessible in?

a) web forms b) 2. web Garden c) both d) none

Answer. web forms – check once

17) Application objects are accessible in?

a) web forms b) Web Garden c) both d) none

Answer. a. web forms

18)Which control have the paging?

a) dataset b) datareader c) None d) All
Answer. dataset

19)Which file contains the configuration settings for URI to access in web services?
Answer. .disco (check it once)

20) I have a datagrid/Gridview can i have a dropdown inside a column and binding to different dataset?
Answer : Yes, using template field

21) How will you fill a dropdown from another dataset and grid from another dataset.
Answer: Fill the grid first than on RowDatabound event find the combo control and bind it with another dataset.

22) How will you add increasing number (index numbers of rows) in datagrid without bringing it from database.

Answer : using rowdatabound

23) Suppose there is two button in a datagrid column. how will you identify which button is clicked?
Answer : using command name and command argument

24) How many nulls unique key can have?
Answer : Only one

25) Can we define unique key on combination of keys?
Answer : yes

Friday, April 8, 2011

Interview Questions -- RG-6

1) What about security in web services?
Never Implemented

2) How will you overload methods in web services?

3) What is the use of eval function?

4) What is XMLHTTP Object?

5) If you have two xml with same structure and we have to create single with distinct daata. How will you do that?

6) If there are duplicate rows in data table how will you get distinct row in ADO .Net and SQL server.

7) Have you used SQL Profiler?

8) Static vairables in C#?

9) Difference between Dispose and Finalizer/

10)What is clustered index?

11) What will you do improve the perfonace ofa page?

12) What is difference between dataset and DataReader.

13) If you have two millions rows in database than whihc one you will use dataset or datareader?

14) What is the use of yield keword?

15) What is dispathcer?

16) Which interface do you use in Remoting?

17) How will you use SOAP Header in Web Services?

Friday, March 4, 2011

Interview Questions TFT -- 5

1) If you have two div and you want to display them left-right than what css style you will use?

Answer: There is a float property which has three possible values : none,left and right, you can use that property to flow the content according to your requirement.By default it is none means your content will flow as it is given.

<div style="background:green;border:1;width:10;height:10;float:left" >
Hello
</div>
<div style="background:yellow;border:1;width:10;height:10">
How are you?
</div>

2) What is the use of dot(.) and Hash(#) in CSS?
We use dot(.) to specify the class and Hash(#) for id. If we define an item with dot(.) in CSS than that style will apply to all elements with the same class. Same for id.

3) If you have two elements with the same id, which one you will get while using getElementById().
Very First One( It will check the physical order of elements, float property will not affect this function).

4) What is the difference between getElementById() and getElemntsByName()
getElementById return single element while getElementsByName return array of elements.

5)What do you do make working like a group of radio buttons?
They should have same name to work like a group.

6) Where we use Having clause?
Having clause used with group by and aggregate functions.
Ex. Select Department from Inno Having avg(Salary)>100000 group by Department

7) Difference Between Clustered Index and Non Clustered Index? Can we have more than one clustered index on a table if not than why?
See Link :- http://interview-preparation-for-you.blogspot.com/2010/11/interview-questions.html

8) What is the difference between lib and binding?
Still Searching....

9) Give me some example of Dynamic polymorphism.
I know only one that is virtual function.

10) Give me some example of call back functions in JQuery.
success function and error function

11) Write a program to print 1-100. All the numbers that are divisible by 3 and 5 should print in word and all other numbers should print in integer.
I know you can write it easily :)

12) You have an array of string. You write a program to get the index of that item which has maximum length.
This is a simple program but you have to write very carefully there should not be any loop holes basically he is checking your coding standard not only logic.

13) Is there any other method to prevent page refresh instead of Update Panel?
Through JQuery you can do it.

14) If you are saving a value using ajax function of JQuery and connection has been break in the middle than how you will handle this situation?
You can attach error call back function to ajax, it will return time out in case of connection break or any other case in which server does not send response.

15) Give me an example of iterator pattern?
See Link :- Iterator Pattern

16) What is the difference between Hashtable and Dictionary?
Dictionary is generic Hashtable is not.When retrieving the values from hashtable you need to typecast them into appropriate type while in case of dictionary there is no need to type cast.

17) What is entity framework?
Don't know.

18)Have you worked in WCF?
NO

19)How will you host webservices?
We can do it just like a web site. by deploying at this path C:\Inetpub\wwwroot. And make it virtual directory from inetmgr.

20) Difference between capturing and bubbling.
See :http://interview-preparation-for-you.blogspot.com/2010/08/bubble-event.html

21) How will you attach error call back function in ajax call?
Don't know

Tuesday, November 30, 2010

Interview Questions on Remoting/Web Services

What are the properties of a [WebMethod ] attribute?
1. Description
2. MessageName
3. EnableSession
4. CacheDuration
5. TransactionOption
6. BufferResponse

Name the layers of the WebServices protocol stack?
Layer 1 --> Transport Layer (HTTP, SMTP,FTP)
Layer 2 --> XML Messaging Layer (XML,SOAP)
Layer 3 --> WSDL Layer
Layer 4 --> UDDI Layer




Is overloading possible in web services?
Yes, We can overload webmethods in a webservice.

There is the MessageName property of a WebMethod attribute! The MessageName property enables the XML Web Service to uniquely identify overloaded methods using an alias. The default value of this property is the method name, but you can change it to distinguish this overloaded method
implementation from others. When specifying the method name, the resulting SOAP messages will reflect this name instead of an actual method name.

What security measures exist for .NET Remoting in System.Runtime.Remoting?
None. Security should be taken care of at the application level. Cryptography and other security techniques can be applied at application or server level.

Can you configure a .NET Remoting object via XML file?
Yes, via machine.config and application level .config file (or web.config in ASP.NET). Application-level XML settings take precedence over machine.config.

How do you define the lease of the object?
By implementing ILease interface when writing the class code.

How can you automatically generate interface for the remotable object in .NET with Microsoft tools?
Use the Soapsuds tool.

What’s a proxy of the server object in .NET Remoting?
It’s a fake copy of the server object that resides on the client side and behaves as if it was the server. It handles the communication between real server object and the client object. This process is also known as marshaling.

Explain what relationship is between a Process, Application Domain, and Application?
A process is an instance of a running application. An application is an executable on the hard drive or network. There can be numerous processes launched of the same application (5 copies of Word running), but 1 process can run just 1 application.

Name the distributed systems available apart from .Net Remoting.
Distributed Computing Environment/Remote Procedure Calls (DEC/RPC),
Microsoft Distributed Component Object Model (DCOM),
Common Object Request Broker Architecture (CORBA), and
Java Remote Method Invocation (RMI).

Define remotable objects in .NET Remoting.
Remotable objects are the objects that can be marshaled across the application domains.You can marshal by value, where a copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.

Advantage of Remoting over Web Services.

.Net Remoting can work with both internet and interanet.
WebService Support only SOAP/HTTP while .Net Remoting support TCP/HTTP.
.Net Remoting best for interanet while web service best for inernet.
.Net Remoting best for homogeneous platform while Web Services best for hetrogeneous platform.
TCP is fast than HTTP.
.Net type system and can expose any object to the client. .Net Web Service supports on those types that can be expressed with XSD.
When to use .Net Remoting over Web services
.Net Remoting provides distributed solution for a corporate use. So, if you need distributed environment to be implemented for internal use, .Net remoting is the best choice. If you require a faster distributed solution, .Net Remoting with TCP protocol using binary format is faster than Web services. .Net Remoting is better solution when large transfer of data is required. Web Services are best when you need to communicate with an external organization or non .NET technology.

What is an application domain?
Previously "PROCESS" were used as security boundaries. One process has its own virtual memory and does not over lap the other process virtual memory; Due to this one process can not crash the other process. So any problem or error in one process does not affect the other process. In .NET they went one step ahead introducing application domains. In application domains multiple applications can run in same process with out influencing each other. If one of the application domains throws error it does not affect the other application domains. To invoke method in a object running in different application domain .NET remoting is used.

What are two different types of remote object creation mode in .NET?
There are two different ways in which object can be created using Remoting:

o SAO (Server Activated Objects) also called as Well-Known call mode.
o CAO (Client Activated Objects).
* SAO has two modes "Single Call" and "Singleton". With Single Call object the object is created with every method call thus making the object stateless. With Singleton the object is created only once and the object is shared with all clients.
* CAO are stateful as compared to SAO. In CAO the creation request is sent from client side. Client holds a proxy to the server object created on server. It is stateful for client bases.


What is fundamental of published or precreated objects in Remoting?
In scenarios of singleton or single call the objects are created dynamically. But in situations where you want to precreate object and publish it you will use published object scenarios.

Dim obj as new objRemote
obj.Initvalue = 100
RemotingServices.Marshal(obj,"RemoteObject")
As shown in above sample following changes will be needed on server side.
RemotingConfiguration.RegisterWellKnownServiceType is replaced by RemotingServices.Marshal(obj,"RemoteObject") where "obj" is the precreated object on the server whose value is initialized to 100


What are the ways in which client can create object on server in CAO model?
There are two ways by which you can create Client objects on remoting server :
Activator.CreateInstance()
By Keyword "New".

And Singleton and SingleCall
RemotingConfiguration.RegisterWellKnownServiceType(GetType(RemotingServer),
"RemoteObject", WellKnownObjectMode.Singleton)


Can Non-Default constructors be used with Single Call SAO?
Non-Default constructors can not be used with single call objects as object is created with every method call, there is no way to define Non-default constructors in method calls. It’s possible to use Non-Default constructor with Client activated objects as both methods "NEW" keyword and "Activator.CreateInstance()" provide a way to specify Non-Default constructors.

What is Asynchronous One-Way Calls?
One-way calls are a different from asynchronous calls from execution angle.In one way call .NET Framework does not guarantee their execution. In addition, the methods used in this kind of call cannot have return values or out parameters. One-way calls are defined by using [OneWay()] attribute in class.

What is marshalling and what are different kinds of marshalling?
Marshaling is used when an object is converted so that it can be sent across the network or across application domains. Unmarshaling creates an object from the marshaled data. There are two ways to do marshalling:
+ Marshal-by-value (MBV): In this the object is serialized into the channel, and a copy of the object is created on the other side of the network. The object to marshal is stored into a stream, and the stream is used to build a copy of the object on the other side with the unmarshalling sequence.
Marshaling-by-reference (MBR): Here it creates a proxy on the client that is used to communicate with the remote object. The marshaling sequence of a remote object creates an ObjRef instance that itself can be serialized across the network.

What is UDDI?
Full form of UDDI is Universal Description, Discovery and Integration. It is a directory that can be used to publish and discover public Web Services. If you want to see more details you can visit the http://www.UDDI.org .

What is ObjRef object in remoting?
All Marshal() methods return ObjRef object.The ObjRef is serializable because it implements the interface ISerializable, and can be marshaled by value. The ObjRef knows about location of the remote object, host name, port number and object name.

What is DISCO?
DISCO is the abbreviated form of Discovery. It is basically used to club or group common services together on a server and provides links to the schema documents of the services it describes may require.

What happens when a client activates a remote object?
When a client activates a remote object, it receives a proxy to the remote object. All operations on this proxy are appropriately indirected to enable the remoting infrastructure to intercept and forward the calls appropriately.

What is considered as Remote Object?
Any object outside the application domain of the calling application is considered remote object, even if the objects are executing on the same machine.

Can you treat every object as a remote object?
Objects that cannot be serialized cannot be passed to a different application domain and are therefore nonremotable.

What are the ways in which an object can be serialized?
1. Mark your class with serializable attribute.
2. Make your class implement ISerializable interface.

Sunday, November 14, 2010

Interview Questions

What is .Net framework?
.Net framework is a set of technologies that form an integral part of .Net. platform. .Net framework provide you a environment to write managed code. It has two main components.
CLR and FCL(Framework Class Library)

What is CLR ?
Common Language Run Time provides the common services to manage code like memory management,Exception Handling and Security.

.Net compiler(Different for different languages) convert source code to CIL(Common Intermediate Language). At run time CLR’s JIT convert CIL to machine code.

What is FCL?
FCL(Framework Class Library) is a set of common classes that is used to access common functionality.

What is CTS?
CTS is a component of CLS.CTS describes the common types used by managed code. It facilitates cross-language integration, type safety and high performance code execution.

What is CLS?
Common Language Specification defines the guidelines for languages to communicate to each other.

What is Manage Code?
To get the facilities of CLR every code should provide a minimum information to CLR. That code provide that information it is called managed code.

What is an Application Domain?
An Application domain is a boundary for a process. A process can contains multiple application domain. It is an isolation for process. An application domain can not communicate directly to other application domain. For that we need proxy.

What is Assembly?
An assembly is a collection of one or more exe or dll. An assembly contains a collection of types and resources that are built to work together and form a logical unit of functionality.

What an assembly contains?
A static assembly can contains four parts.
1) Manifest
2) Type Metadata- Binary information that describes a program
3) IL
4) A set of resources.

What is manifest?
Manifest describes the assembly itself.
Manifest contains the assembly metadata. An assembly manifest contains the information about the identity and version of the assembly. It also contains the information required to resolve references to type and resources.

What is Strong Name?
To place an assembly in GAC we need to assign a strong name to that assembly. Strong Name Include text name, version and culture information, a public and a digital signature signature generated over that assembly. There is a tool Sn.exe verification and key pair and signature generation.

Satellite Assembly
An assembly that contains only resources is called satellite assembly. It is used often to deploy language specific resources for an application.

Sleep,Suspend and Resume
Suspend allows you to block a thread until another thread call Thread.Resume.
Sleep allow you to block a thread for a specific time or for inifinite time.

.Net framework does not suspend a thread until it determine that it is in a safe place to suspend, while Sleep immediately put a thread into wait state.

Join
Join wait for a previous thread to complete and after the completion of previous thread it is started.

Daemon Thread
A background thread is called daemon thread. we can do it by setting the property IsBackground=true. GC is an example of Daemon thread.

Can we use events with threads?
Yes events can be used with thread. This is one of the technique to synchronize one thread with other.

How can we know thread state?
ThreadState property can be used to determine the state of thread. It is an enumeration.

How to stop a long running thread?
Thread.Stop() method can be called for that.

How do you implement synchronization ?
lock and Synclock
Two thread can try to access the same variable at same time. This can create the problem.To avoid it you can use lock to lock a variable but if two threads lock a variable at same time it can be cause a deadlock problem.
Synclock x
//Do something
End Synclock

What is use of Interlocked class?
Interlocked class provides methods by which you can achieve following functionality?
1) Increment Value
2) Decrement Value
3) Exchange Value between variables
4) Compare Values from any thread in synchronize mode.

Monitor object
Monitor object are used to ensure that a block of code runs without interruption of other thread. This is a way of synchronization, code from other thread can not run until code written in synch block has finished.

What are wait handles?
1) WaitOne
2) WaitAny
3) WaitAll

When a thread wants to release a wait handle it can call set method.

Mutex Object
Mutex object is a synchronized object that can be used by only one thread at a time. If it is owned by a thread its state is signaled and if it is not owned by any thread its state is non signaled. Exapmle :- If you want that at a time only single instance of an application should run than you can use Mutex object

What is ManualResetEvent and AutoResetEvent?
Thread that called wait method of synchronize event must wait until another thread signal the event by calling Set method.

In case of ManualReset event we use Set method to signaled. Threads set the status of ManualResetEvent instances to non signaled using the Reset method or when control returns to waiting Waitone call.

Instances of AutoResetEvent class can also be set to Signaled using set, But they automatically return to non signaled as soon as a waiting thread is notified that the event become signaled.

Index
Indexes are created on columns of table or views. The index provides a fast way to look up data based on the values within these columns.
For example if you create an index on the primary key and search a row based on that primary key, SQL server first find that values in the index and then uses that index to find the entire row.
Without the index, a table scan would have to be performed in order to locate the data.
You can not create index on large data type like image,text,varchar(max).

Clustered Index :-
Clustered index is unique for any given table and we can have only one clustered index on a table. The leaf level of a clustered index is the actual data and the data is resorted in case of clustered index.

Non Clustered Index :-
Whereas in case of non-clustered index the leaf level is actually a pointer to the data in rows so we can have as many non-clustered indexes as we can on the db(max 249).

Followers

Link