Showing posts with label Interview Q and A. Show all posts
Showing posts with label Interview Q and A. Show all posts

Sunday, May 26, 2013

.NET Interview Question: Garbage Collection

Q1. What is garbage collection?

Garbage collection is a heap-management strategy where a run-time component takes responsibility for managing the lifetime of the memory used by objects. This concept is not new to .NET - Java and many other languages/runtimes have used garbage collection for some time.

.NET Interview Question: Application Domains

Q1. What is an application domain?

An AppDomain can be thought of as a lightweight process. Multiple AppDomains can exist inside a Win32 process. The primary purpose of the AppDomain is to isolate applications from each other, and so it is particularly useful in hosting scenarios such as ASP.NET. An AppDomain can be destroyed by the host without affecting other AppDomains in the process.

Thursday, May 23, 2013

Interview Question .NET Assemblies

Q1. What is an assembly?

An assembly is sometimes described as a logical .EXE or .DLL, and can be an application (with a main entry point) or a library. An assembly consists of one or more files (dlls, exes, html files etc), and represents a group of resources, type definitions, and implementations of those types. An assembly may also contain references to other assemblies. These resources, types and references are described in a block of data called a manifest. The manifest is part of the assembly, thus making the assembly self-describing.

An important aspect of assemblies is that they are part of the identity of a type. The identity of a type is the assembly that houses it combined with the type name. This means, for example, that if assembly A exports a type called T, and assembly B exports a type called T, the .NET runtime sees these as two completely different types. Furthermore, don't get confused between assemblies and namespaces - namespaces are merely a hierarchical way of organising type names. To the runtime, type names are type names, regardless of whether namespaces are used to organise the names. It's the assembly plus the typename (regardless of whether the type name belongs to a namespace) that uniquely indentifies a type to the runtime.

Assemblies are also important in .NET with respect to security - many of the security restrictions are enforced at the assembly boundary. Finally, assemblies are the unit of versioning in .NET - more on this below.

Wednesday, May 22, 2013

Java Interview Questions and Answers Part 16

Q141. How to make an array copy from System?

There is a method called arraycopy in the System class. You can do it: System.arraycopy(sourceArray, srcOffset, destinationArray, destOffset,
numOfElements2Copy);
When you use this method, the destinationArray will be filled with the elements of sourceArray at the length specified.

Java Interview Questions and Answers Part 15

Q131. What is the relationship between synchronized and volatile keyword?

The JVM is guaranteed to treat reads and writes of data of 32 bits or less as atomic.(Some JVM might treat reads and writes of data of 64 bits or less as atomic in future) For long or double variable, programmers should take care in multi-threading environment. Either put these variables in a synchronized method or block, or declare them volatile.

Tuesday, May 21, 2013

Java Interview Questions and Answers Part 14

Q121. Can you make an instance of an abstract class? For example - java.util.Calender is an abstract class with a method getInstance() which returns an instance of the Calender class.

No! You cannot make an instance of an abstract class. An abstract class has to be subclassed. If you have an abstract class and you want to use a method which has been implemented, you may need to subclass that abstract class, instantiate your subclass and then call that method.

Monday, May 20, 2013

Java Interview Questions and Answers Part 13

Q111. What is a Container in a GUI?

A Container contains and arranges other components (including other containers) through the use of layout managers, which use specific layout policies to determine where components should go as a function of the size of the container.

Sunday, May 19, 2013

Java Interview Questions and Answers Part 12

Q101. What interface must an object implement before it can be written to a stream as an object?

An object must implement the Serializable or Externalizable interface before it can be written to a stream as an object.

Tuesday, May 7, 2013

Java Interview Questions and Answers Part 11

Q91. What is casting?

There are two types of casting, casting between primitive numeric types and casting between object references. Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values. Casting between object references is used to refer to an object by a compatible class, interface, or array type reference.

Saturday, April 27, 2013

Java Interview Questions and Answers Part 10

Q81. Which class should you use to obtain design information about an object?

The Class class is used to obtain information about an object's design.

Monday, April 22, 2013

Java Interview Questions and Answers Part 9

Q71. Which package has light weight components?

javax.Swing package. All components in Swing, except JApplet, JDialog, JFrame and JWindow are lightweight components.

Java Interview Questions and Answers Part 8

Q61. What is the purpose of the finally clause of a try-catch-finally statement?

The finally clause is used to provide the capability to execute code no matter whether or not an exception is thrown or caught.

Sunday, April 21, 2013

Java Interview Questions and Answers Part 7

Q51. How does Java handle integer overflows and underflows?

It uses low order bytes of the result that can fit into the size of the type allowed by the operation.

Java Interview Questions and Answers Part 6

Q41.  What are wrapped classes?

Wrapped classes are classes that allow primitive types to be accessed as objects.

Saturday, April 20, 2013

Java Interview Questions and Answers Part 5

Q31. What happens when a thread cannot acquire a lock on an object?

If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object's lock, it enters the waiting state until the lock becomes available.

Saturday, April 13, 2013

Thursday, April 11, 2013

Java Interview Questions and Answers Part 3


Q11. Name the container which uses Border Layout as their default layout?

A container which uses Border Layout as their default are: window, Frame and Dialog classes.

Java Interview Questions and Answers Part 2


Q1. How are Observer and Observable used?

Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated, it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by objects that observe Observable objects.

Tuesday, April 9, 2013

Java Interview Questions and Answers Part 1

Q1. What is Collection API ?

The Collection API is a set of classes and interfaces that support operation on collections of objects. These classes and interfaces are more flexible, more powerful, and more regular than the vectors, arrays, and hashtables if effectively replaces. Example of classes: HashSet, HashMap, ArrayList, LinkedList, TreeSet and TreeMap. Example of interfaces: Collection, Set, List and Map.

Sunday, March 10, 2013

ASP.NET Interview Question Part 5


Q41. What are the events that happen when a client requests an ASP.NET page from IIS server?


The following events happen when a client requests an ASP.NET page from the IIS server:
Automatic Traffic Exchange

YallaTech Facebook page