PDF's, how about a self owned hard copy. nvrehs.info Interview-Questions-Shivprasad- Some other books by Shivprasad Koirala. Update is that Shivprasad nvrehs.info interview question book has launched. We will now continue this quiz from 4th June , Winner will be. 6th Edition. By. Shivprasad Koirala. (Around plus Interview questions from nvrehs.info Interviews) PDF's, how about a self owned hard copy. If you want to download from online .. What is the latest version of MVC? What is the difference.
|Language:||English, Spanish, Japanese|
|Genre:||Academic & Education|
|Distribution:||Free* [*Register to download]|
NET Interview Questions and answer: Practical Implementation Learning WCF: # 11 Nail the Job Interview Dynamite Answers to Interview Questions Second Edition, by Richard Templar, published by Pearson Education Limited. NET: Interview Questions: nvrehs.info: Shivprasad Koirala: Books. Paperback: pages; Publisher: BPB Publications; 7th Revised edition; 7th Revised edition (); Language: I got the book with latest 6th revised version including CD. In this article we will nvrehs.info interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.
Its a subjective matter which language is best. Some like VB. Both use the same framework and speed is also very much equivalents. But still lets list down some major differences between them: Legacy VB functionalities can be used by using Microsoft.
VisualBasic namespace. NET part of Visual Studio. NET compiles your code in the background. While this is considered an advantage for small projects, people creating very large projects have found that the IDE slows down considerably as the project gets larger.
NET but is been introduced in Whidbey. This allows pointer arithmetic etc, and can improve performance in some situations. However, it is not to be used lightly, as a lot of the normal safety of C is lost as the name implies.
This is the major difference that you can access unmanaged code in C and not in VB. But note they will be variations and they will map to some question of this book. All exception derives from Exception Base class. Exceptions can be generated programmatically or can be generated by system. Application Exception serves as the base class for all application-. It derives from Exception but does not provide any extended functionality. You should derive your custom application exceptions from Application Exception.
Application exception are used when we want to define user defined exception. While system exception are all which are defined by. As such I have never used application exception; I think most of the work is done using System exception classes.
CAS is part of. NET security model that determines whether or not a piece of code is allowed to run and what resources it can use while running. Example CAS will allow a application to read but now write and delete rights are given to the application. In multilingual application in. NET to support multilingual functionality you can have modules which are customized for localization. These assemblies are called as satellite assemblies.
You can distribute these assemblies separately than the core modules. NET Interoperability. Following are the ways with which you can generate RCW: See figure below Adding reference using VS. NET Interopservices namespace contains class TypeLib Converter which provides methods to convert COM classes and interface in to assembly metadata. If your COM component does not have type library then the only way to communicate is writing custom wrappers. That means communicating directly with COM components.
NET assemblies. Following are the different approaches to implement it: Customer Name. Note also the class must have a default constructor. NET that does not mean that author of the book does not like C. In fact the main programming language of author is C. In order to keep things small i have only used one language. But the conversion is so seamless its of least matter. Here interfaces are created automatically. Following are different type of class attributes: No class interface is generated for the class.
This is default setting when you do not specify anything. However, no type information is produced. Typeinfo is produced and made available in the type library. In below source code we have used the third attribute. Imports System. Other than class attributes defined up there are other attributes with which you can govern other part of assembly. All attributes are not in scope of the book as this is a interview questions book refer MSDN for more details.
NET assembly is created using either interface or using interopservices method we need to create a COM type library using Type library export tool. Either we can specify Unicode to convert all strings to Unicode values, or Auto to convert strings according to the.
NET runtime rules. Below is a sample code for VB. Load MessageBox. In VB. Generic; using System. ComponentModel; using System. Data; using System.
Drawing; using System. Forms; using System. InteropServices; endregion. B When we use windows API in. Windows API in. NET is unmanaged code. Still there are decent old application which are working with COM very much fine. I What is COM? It is a binary standard which is language independent. Reference counting is a memory management technique used to count how many times an object has a pointer referring to it.
The first time it is created, the reference count is set to one. When the last reference to the object is nulled, the reference count is set to zero and the object is deleted. Care must be exercised to prevent a context switch from changing the reference count at the time of deletion.
In the methods that follow, the syntax is shortened to keep the scope of the discussion brief and manageable. All interfaces are classes derived from the base class IUnknown. Each interface supports methods access data and perform operations transparently to the programmer. Suppose that pinterf is a pointer to an IUnknown.
The protocol which is actually being used is registered just prior to use, as opposed to being registered at initialization time. The reason for this is that if a protocol is not being used, it will not be loaded. In order to inform an object that the client is still alive, periodic pinging is used. Hence, when the client has died and no ping has been received to refresh it before the expiration time, the server object will perform some clean up tasks including decrementing its reference count.
Since RPC across a network are typically slow compared to processes residing on the same machine , DCOM sends multiple requests in the same call. This clustering optimization trick is also used when creating an instance of the object and serializing it with data. Since these two operations usually occur together, DCOM allows one method which will perform both operations in one call without waiting for an acknowledgment from the first task before performing the second one.
Similarly, when a client pings its server object, he can do it in one call. Moreover, if there are multiple clients sending pings to multiple servers, an optimization is made where the multiple pings going to the same object are consolidated into just one ping.
This is to cut down on the use of precious bandwidth used only for pinging. The client has the control to set the computer which will be responsible for the lifetime of the object. That is to say, these objects are not created just somewhere where the system resources and access privileges allow for it. Call security is implemented in all four ways: The security issues are handled as they are on.
The client gives the server various access privileges to access memory or disk space. You have to put the server name in the registry. A How to implement DTC in. Its time to define at the method level the AutoComplete attribute. Autocomplete attribute says that if no exception is thrown then mark its part of the transaction as being okay. This helps cut down on the amount of code required. If the implementation sets AutoComplete to false, or. To manually control the transaction you will need to use the ContextUtil class and its static members.
Following is small snippet of ContextUtil: Not Supported: Hence even if the calling component in the hierarchy is transaction enabled this component will not participate in the transaction. If the calling component is not transaction enabled this component will not start a new transaction. Required New: Components with required new transaction type instantiate a new transaction for themselves every time.
A How do you do object pooling in. ObjectPooling MinPoolSize: Below is a sample code which uses the class. Note the DisposeObject This ensures its safe return to the object pool. A What are types of compatibility in VB6? There are three possible project compatibility settings: This will cause any compiled client components to fail with error ! This will still cause any compiled client components to fail with error !
Recompilation of client components will restore them to working order again. It can do this, because it silently creates a new interface ID for the extended interface and adds registration code to register the original interface ID but with a new Forward key containing the value of this new interface ID. COM will then substitute calls having the old ID with the new ID and hence applications built against the old interface will continue to work assuming the inner workings of the component remain backward compatible!
Its a feature of modern operating systems with which we can run multiple programs at same time example Word,Excel etc.
B What is Multi-threading? Multi-threading forms subset of Multi-tasking instead of having to switch between programs this feature switches between different parts of the same program. Example you are writing in word and at the same time word is doing a spell check in background. While VB6 supports multiple single-threaded apartments, it does not support a free- threading model, which allows multiple threads to run against the same set of data.
One or more threads run in an AppDomain. An AppDomain is a runtime representation of a logical process within a physical process. Each AppDomain is started with a single thread, but can create additional threads from any of its threads.
Threading has all the classes related to implement threading. NET application who wants to implement threading has to import this namespace.
NET program always has atleast two threads running one the main program and second the garbage collector. Start pthread2. Above is a sample code which shows simple sample code for threading.. This happens because of thread priorities. The first thread is run with highest priority. Thread Priority can be changed by using Threadname. In the sample provided look out for code where the second thread is ran with a high priority.
The AddressOf operator creates a delegate object to the BackgroundProcess method. A delegate within VB. NET is a type-safe, object-oriented function pointer. After the thread has been instantiated, you begin the execution of the code by calling the Start method of the thread.
CurrentThread" refers to the current thread running in the method. Thread's execution can be paused by calling the Thread. Sleep method.
This method takes an integer value that determines how long the thread should sleep. Example Thread. Sleep You can also place a thread into the sleep state for an indeterminate amount of time by calling Thread. Sleep System. To interrupt this sleep you can call the Thread. Interrupt method. It is Similar to Sleep and Interrupt. Suspend allows you to block a thread until another thread calls Thread. The difference between Sleep and Suspend is that the latter does not immediately place a thread in the wait state.
The thread does not suspend until. NET runtime determines that it is in a safe place to suspend it. Sleep will immediately place a thread in a wait state. They look very similar. This window is only seen when the program is running in debug mode.
The Thread. Join method is useful for determining if a thread has completed before starting another task. The Join method waits a specified amount of time for a thread to end. If the thread ends before the time-out, Join returns True; otherwise it returns False. Once you call Join the calling procedure stops and waits for the thread to signal that it is done. Example you have "Thread1" and "Thread2" and while executing 'Thread1" you call "Thread2.
Join ". So "Thread1" will wait until "Thread2" has completed its execution and the again invoke "Thread1". Join Integer ensures that threads do not wait for a long time. If it exceeds a specific time which is provided in integer the waiting thread will start. Daemon thread's run in background and stop automatically when nothing is running program. Example of a Daemon thread is "Garbage collector". Garbage collector runs until some. NET code is running or else its idle.
You can make a thread Daemon by Thread. There are a somethings you need to be careful with when using threads. If two threads e. This can be very difficult to debug because they may not always do it at exactly the same time. To avoid the problem, you can lock a variable before accessing it.
However, if two threads lock the same variable at the same time, you'll have a deadlock problem. Yes you can use events with threads , this is one of the technique to synchronize one thread with other.
Thread can have one or combination of status. Threadstate enumeration has all the values to detect a state of thread. Some sample states are Isrunning,IsAlive,suspended etc. Interlocked class provides methods by which you can achieve following functionalities: Increment IntA. Monitor objects are used to ensure that a block of code runs without being interrupted by code running on other threads. In other words, code in other threads cannot run until code in the synchronized code block has finished.
SyncLock and End SyncLock statements are provided in order to simplify access to monitor object. Wait handles sends signals of a thread status from one thread to other thread. There are three kind of wait modes: When a thread wants to release a Wait handle it can call Set method.
You can use Mutex mutually exclusive objects to avail for the following modes. Mutex objects are synchronization objects that can only be owned by a single thread at a time. Threads request ownership of the mutex object when they require exclusive access to a resource. Because only one thread can own a mutex object at any time, other threads must wait for ownership of a mutex object before using the resource.
The WaitOne method causes a calling thread to wait for ownership of a mutex object. If a thread terminates normally while owning a mutex object, the state of the mutex object is set to signaled and the next waiting thread gets ownership. Threads that call one of the wait methods of a synchronization event must wait until another thread signals the event by calling the Set method.
There are two synchronization event classes. Threads set the status of ManualResetEvent instances to signaled using the Set method.
Threads set the status of ManualResetEvent instances to nonsignaled using the Reset method or when control returns to a waiting WaitOne call. Instances of the AutoResetEvent class can also be set to signaled using Set, but they automatically return to nonsignaled as soon as a waiting thread is notified that the event became signaled. You may want to lock a resource only when data is being written and permit multiple clients to simultaneously read data when data is not being updated.
The ReaderWriterLock class enforces exclusive access to a resource while a thread is modifying the resource, but it allows nonexclusive access when reading the resource. ReaderWriter locks are a useful alternative to exclusive locks that cause other threads to wait, even when those threads do not need to update data.
A good and careful planning can avoid deadlocks. There so many ways microsoft has provided by which you can reduce deadlocks example Monitor ,Interlocked classes , Wait handles, Event raising from one thread to other thread , ThreadState property which you can poll and act accordingly etc. A thread is a path of execution that run on CPU, a process is a collection of threads that share the same virtual memory.
A process has at least one thread of execution, and a thread always run in a process context. These questions can take only to a basic level. If you are attending interviews where people are looking for threading specialist , try to get more deep in to synchronization issues as that's the important point they will stress. Remoting and Webservices. 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. NET they went one step ahead introducing application domains. In application domains multiple application 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. NET remoting you can make remote object calls which lie in different Application Domains. As the remote objects run in different process client calling the remote object can not call it directly. So the client uses a proxy which looks like a real object.
When client wants to make method call on the remote object it uses proxy for it. Client Channel communicates with Server Channel. Server Channel uses as formatter to deserialize the message and sends to the remote object.
There are two different ways in which object can be created using Remoting: 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.
In CAO the creation request is sent from client side. Client holds a proxy to the server object created on server. For these type of questions interviewer expects small and sweet answers. He is basically looking at what you know about the specific subject. For these type of question this book will provide detail code which is not necessary to be said during interview. Only the basic steps and overall brief are enough to convince that you have knowledge about the subject.
Even though this question has detail code and answer say only what is needed in interview. Above is the figure which shows the three important project sections needed to implement remoting. First important section is the common interface between Ser ver and Client. For sample project interface is very simple with only two methods: In this sample server is using HTTP channel and the server object is singleton.
Imports System Imports System. Remoting Imports System. Http Imports System. Channels Imports InterFaceRemoting. Singleton Console. End Sub End Module Following is detail explanation: Following is the code.
This is the time when we specify what mode the server object will be created i. Singleton or SingleCall. This is done by the following below given code. Note in sample we are hosting the server object in singleton mode that means that the same object. Singleton Now comes the final section that is third section the client which will connect to this hosted remoting object. Following is a detail explanation of client code: Note whatever channel the server is using same will be used by the client.
But actually the object is a proxy. InterFaceRemoting ChannelServices. ToString Console. ReadLine End Sub. End Module You an run the program and see the output. For running the program run the server program which is in server directory. If the EXE runs properly following will be the screen as shown below. Following will be the output seen. This means that the client connected to the server program and displayed the data in the server object. Same value is displayed at the client side as shown in figure below.
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. There are two ways by which you can create Client objects on remoting server: In CAO remoting model client creates a instance on server and instance variable set by client on server can be retrieved again with correct value.
Remoting Clients and Remoting Server can communicate because they share a common contract by implementing Shared Interface or Base Class As seen in previous examples. Shipping the server object to client is not a good design practice. RemotingServer -nowp -oa: Server code will change as follows: On client side we have to reference the generated ClientMetaData.
Below are changes which are needed to be incorporated at the Remoting Client: RemoteObject is class which is obtained from ClientMetaData. Now you can reference the object as normal object. This is a very important question from practical implementation point of view. In normal. NET environment objects lifetime is managed by garbage collector. But in remoting environment remote clients can access objects which is out of control of garbage collector.
Garbage collector boundary is limited to a single PC on which framework is running , any remote client across physical PC is out of control of GC Garbage Collector. This leasetime is decreased at certain intervals. Again for every method call a default of two minutes is assigned. When i say method call means every call made from client. If we take NumberOfMethodCalls as one. Sponsor is a object which decides should object Lifetime be renewed.
So it queries any registered sponsors with the object , if does not find any then the object is marked for garbage collection. After this garbage collection has whole control on the object lifetime. SponsorShipTimeOut is time unit a call to a sponsor is timed out.
NET remoting. Below is a figure shown which can give a clear idea of how the file looks like.
Both remoting server and remoting client parameters can be provided through config files. Below is a sample of server config file which provides all remoting parameter values which we where providing through code.
Later this config file can be loaded using the following code. Configure AppDomain. If you run Server and Client following output can be seen.
All previous examples are synchronous method calls , that means client has to wait until the method completes the process. By using Delegates we can make Asynchronous method calls. One-way calls are a different from asynchronous calls from execution angle that the.
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.
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: 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. The marshaling sequence of a remote object creates an ObjRef instance that itself can be serialized across the network.
Marshal is used. Marshal has following overloaded versions: The objUri is the path that is stored within the marshaled object reference; it can be used to access the remote object. The requestedType can be used to pass a different type of the object to the object reference. This is useful if the client using the remote object shouldn't use the object class but an interface that the remote object class implements instead.
In this scenario the interface is the requestedType that should be used for marshaling. 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: Web Services are business logic components which provide functionality via the Internet using standard protocols such as HTTP.
SOAP is platform independent so the consumer of a Web Service is therefore completely shielded from any implementation details about the platform exposing the Web Service.
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: It is basically used to club or group common services together on a server and provide links to the schema documents of the services it describes may require. XML grammar describes details such as: Full WSDL specification is available at http: The following are the different steps needed to get a proxy object of a webservice at the client side: ASMX is extension for Webservices.
In VS webproject is created from the menu itself as compared to where it was present in the explorer. B Which attribute is used in order that the method can be used as WebService? WebMethod attribute has to be specified in order that the method and property can be treated as WebService.
A What are the steps to create a webservice and consume it? A simple webservice will be created which takes two number and gives addition result of the two number. Definitely the. This webservice will add two numbers and give to the calling client. All the below steps are according to VS beta editor: This is one chapter I always thought I should work one. But for now I have kept the same questions and updated some answers which were not looking proper. Added some questions around WCF 4.
Not much changed in this and chapter as such but added some few more architectures and patterns like MVVM and repository pattern.
In this chapter I have done major revamps and addition. Updated some old threading answers and added questions around TPL Task parallel libarary. Some of the question I was not sure where I should put it like algorithms , questions around debug release , packaging etc.
So this chapter will serve that purpose. I have started adding questions around algorithm's in this chapter. This is really a gift to my developer friends. I am sure my book will read by lot of fresher friends. So in case they want to learn. NET step by step , I have shipped the videos of Learn. Visit us www. Back To Blog.
Enter pincode. Usually delivered in days? Koirala Shiprasad. English Binding: Paperback Publisher: Frequently Bought Together. Learn MVC in 7 Days.
Add 3 Items to Cart. Rate Product. This is a good book for final round of brush up and quick heads-up on some of the key topics. Not all topics are covered at good length but pretty useful. But subscription to Questponddvd. But I am still giving 5 star coz of efforts put to compile all topics.
Please do grammar check before publish. Content review needs t Gajanan Madgeri 6 May, This book contains some spelling mistakes but a good download at this price Arka Dutta Certified downloader 30 Sep, Really superb book Vigneshkumar Appiya 30 Oct, Very good book.
Very much useful for interviews even for freshers. Most of the topics are covered by this book. There is a CD included which contains code, as well as some videos which are very useful.