Articles : Microsoft Learning Announces Prometric as Exam Delivery Provider (Worldwide)

We're pleased to announce that Prometric will be the exam delivery provider for Microsoft professional certification and Microsoft Dynamics exams. Microsoft Learning is confident that this model will allow us to provide you with a better testing experience. We anticipate increased speed to market for exam innovations, improved consistency in your test-taking environment, and excellent global coverage. Pearson VUE will discontinue selling Microsoft professional certification exams after August 31, 2007, but will continue to administer Microsoft professional certification exams purchased through December 31, 2007.

We know many of you will have questions on what this means to you and your plans for certification testing. Microsoft Learning and Prometric will take every step to minimize any inconvenience to you during this transition. We encourage you to:
• Learn more.
• Read the Prometric press release.

Articles : Hibernate and NHibernate

Hibernate is an ORM [Object-Relational Mapping] service used to develop persistent Java classes. On the back of NHibernate, it's popularity has spread to the .NET space as well. This has proved of special interest in IT shops that are working toward interoperability strategies that leverage the skills of developers who can handle both .NET and Java problems.

NHibernate is a port of Hibernate Core for Java to the .NET Framework. It handles persisting plain .NET objects to and from an underlying relational database. Given an XML description of your entities and relationships, NHibernate automatically generates SQL for loading and storing the objects. Optionally, you can describe your mapping metadata with attributes in your source code.

NHibernate supports transparent persistence, your object classes don't have to follow a restrictive programming model. Persistent classes do not need to implement any interface or inherit from a special base class. This makes it possible to design the business logic using plain .NET (CLR) objects and object-oriented idiom.

Originally being a port of Hibernate 2.1, the NHibernate API is very similar to that of Hibernate. All Hibernate knowledge and existing Hibernate documentation is therefore directly applicable to NHibernate


NHibernate key features:
Natural programming model - NHibernate supports natural OO idiom; inheritance, polymorphism, composition and the .NET collections framework, including generic collections.

Native .NET - NHibernate API uses .NET conventions and idioms
Support for fine-grained object models - a rich variety of mappings for collections and dependent objects

No build-time bytecode enhancement - there's no extra code generation or bytecode processing steps in your build procedure

The query options - NHibernate addresses both sides of the problem; not only how to get objects into the database, but also how to get them out again

Custom SQL - specify the exact SQL that NHibernate should use to persist your objects. Stored procedures are supported on Microsoft SQL Server.

Support for "conversations" - NHibernate supports long-lived persistence contexts, detach/reattach of objects, and takes care of optimistic locking automatically

Free/open source - NHibernate is licensed under the LGPL (Lesser GNU Public License)

More detailes at official website :: http://www.hibernate.org/

Articles : .NET Dashboard Suite 3.0

Perpetuum Software LLC has released version 3.0 of .NET Dashboard Suite for Windows Forms apps in the field of information acquisition and comprehension.
With .NET Dashboard Suite, users have a pack of fully compatible components for general and specific data visualization. One of the main benefits of the dashboards is the ability to display data in various forms.

.NET Dashboard Suite provides a complete set of data visualization tools: high-resolution ready-made gauges, charts, graphs, diagrams and much more.

It allows the creation of non-standard controls based on existing ones, or even designing from scratch, through improved designer; some properties are available not only in the property grid but also from the designer toolbar.

The unique architecture of the product makes possible the ability to combine objects arbitrarily, allowing the creation of control configurations that are difficult or impossible to build using other approaches. You can create even the most complicated dynamic and interactive dashboards to monitor and analyze your critical data.

.NET Dashboard Suite gives developers a free hand over the dashboard customization: from the appearance to the behavior of the controls. It lets you monitor your business performance using highly visual gauges and charts on your desktop.

The package consists of the following components: Chart ModelKit, and Instrumentation ModelKit.

All components are written in C#, fully compatible with each other and provide similar design-time and runtime customization facilities, common data management, and appearance customization methods.

There are two versions of the product: the .NET Dashboard 2.3 that is compatible with the .NET 1.1 and 2.0 and the .NET Dashboard 3.0 that is specially designed for the .NET Framework 2.0.

Follow this link to download the fully-functional trial version.

Why to use Interfaces Whenever Possible in C#

The .NET Framework contains both classes and interfaces. When you write routines, you will find that you probably know which .NET class you're using. However, your code will be more robust and more reusable if you program using any supported interfaces instead of the class you happen to be working with at the time. Consider this code:

private void LoadList (object [] items,
ListBox l) {
for (int i = 0; i < items.Length;i++)
l.Items.Add (items[i].ToString ());
}

This function loads a ListBox from an array of any kind of objects. The code is limited to an array only. Suppose that later you find that objects are stored in a database, or in some other collection. You need to modify the routine to use the different collection type. However, had you written the routine using the ICollection interface, it would work on any type that implements the ICollection interface:

private void LoadList (ICollection items,
ListBox l) {
foreach (object o in items)
l.Items.Add (o.ToString ());
}

The ICollection interface is implemented by arrays, and all the collections in the System.Collection. In addition, multidimensional arrays support the ICollection interface. If that's not enough, the database .NET classes support the ICollection interface as well. The function written using the interface can be reused many more ways without any modification.

C# : foreach loop much faster than normal for loop

Using a foreach loop will be substantially faster than a for loop when accessing the items in a RichTextBox's Lines property. For example, the following code loads a RichTextBox with 1000 lines of text and accesses each line from the Lines property. On a 333 MHz Pentium II machine, the for-loop code (ForLoopButton_Click) takes ~25 seconds and the foreach code (ForEachLoopButton_Click) takes ~0.01 seconds.
...
private void Form1_Load(object sender, System.EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
StringBuilder Buffer = new StringBuilder("");
for (int i = 1; i <= 1000; i++)
{
if (i > 1)
{
Buffer.Append(Environment.NewLine);
}
Buffer.Append("This is line number " + i.ToString());
}
TheRichTextBox.Text = Buffer.ToString();
Cursor.Current = Cursors.Arrow;
}

private void ForLoopButton_Click(object sender, System.EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
int Len = 0;
int Start = Environment.TickCount;
for (int i = 0; i < TheRichTextBox.Lines.Length; i++)
{
Len += TheRichTextBox.Lines[i].Length;
}
int ElapsedTime = Environment.TickCount - Start;
ResultsTextBox.Clear();
ResultsTextBox.Text = "for loop\r\n\r\nElapsed time = " + ((double) ElapsedTime / (double) 1000.0).ToString() + " seconds\r\n\r\nResult = " + Len.ToString();
Cursor.Current = Cursors.Arrow;
}

private void ForEachLoopButton_Click(object sender, System.EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
int Len = 0;
int Start = Environment.TickCount;
foreach (String Line in TheRichTextBox.Lines)
{
Len += Line.Length;
}
int ElapsedTime = Environment.TickCount - Start;
ResultsTextBox.Clear();
ResultsTextBox.Text = "foreach loop\r\n\r\nElapsed time = " + ((double) ElapsedTime / (double) 1000.0).ToString() + " seconds\r\n\r\nResult = " + Len.ToString();
Cursor.Current = Cursors.Arrow;
}

Windows Forms Interview Question with Answer

How would you create a non-rectangular window, let’s say an ellipse?
Create a rectangular form, set the TransparencyKey property to the same value as BackColor, which will effectively make the background of the form transparent. Then set the FormBorderStyle to FormBorderStyle.None, which will remove the contour and contents of the form.
What’s the difference between WindowsDefaultLocation and WindowsDefaultBounds?

WindowsDefaultLocation tells the form to start up at a location selected by OS, but with internally specified size. WindowsDefaultBounds delegates both size and starting position choices to the OS.
My progress bar freezes up and dialog window shows blank, when an intensive background process takes over

Yes, you should’ve multi-threaded your GUI, with taskbar and main form being one thread, and the background process being the other.

or Application.DoEvents can be used also
How do you retrieve the customized properties of a .NET application from XML .config file?



Initialize an instance of AppSettingsReader class. Call the GetValue method of AppSettingsReader class, passing in the name of the property and the type expected. Assign the result to the appropriate variable.

How can you save the desired properties of Windows Forms application?

config files in .NET are supported through the API to allow storing and retrieving information. They are nothing more than simple XML files, sort of like what .ini files were before for Win32 apps.

JavaScript Interview Question

1.Can javascript code be broken in different lines?
2.What is a prompt box?
3.What is the difference between an alert box and a confirmation box?
4.How to access an external javascript file that is stored externally and not embedded?
5.Is a javascript script faster than an ASP script?
6.What does the “Access is Denied” IE error mean?
7.How to set a HTML document’s background color?
8.What can javascript programs do?
9.Where are cookies actually stored on the hard disk?
10.How to detect the operating system on the client machine?
11.How to read and write a file using javascript?
12.What is JavaScript?
13.What is jrunscript?
14.Is it possible to set session variables from javascript?
15.What is Client side and server side scripting?
16.What is a Java Bean?
17.Why do you Canvas ?
18.What is the difference between this() and super()?
19.How do you get the value of a combo box in Javascript?
20.How can I call a Java method from Javascript?
21.What’s relationship between JavaScript and ECMAScript?
22.What does “1″+3+6 evaluate to and also what about 2+5+”6″?
23.What is negative infinity?
24.What does isNaN function do?
25.How do you convert numbers between different bases in JavaScript?
26.What are JavaScript data types?
27.What is the difference between error and an exception?
28.What is the future of JavaScript?
29.What about this Ecmascript? Is it just a version of Javascript?
30.How can JavaScript be used to personalize or tailor a Web site to fit individual users?
31.How can JavaScript make a Web site easier to use? That is, are there certain JavaScript techniques that make it easier for people to use a Web site?
32.Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?
33.Where are cookies actually stored on the hard disk?
34.How to create a function using function constructor?
35.What does break and continue statements do?
36.What does the delete operator do?
37.What are undefined and undeclared variables?
38.Does javascript have the concept level scope?
39.What is variable typing in javascript?
40.What is the difference between undefined value and null value?
41.What does undefined value mean in javascript?
42.What does javascript null mean?
43.Name the numeric constants representing max,min values
44.How to comment javascript code?
45.How to hide javascript code from old browsers that dont run it?
46.JavaScript V/s JAVA
47.Name some builtin functions of JavaScript?
48.How to put a JavaScript into an HTML document?

MBA Interview Questions

·Discuss your career progression.
·Give examples of how you have demonstrated leadership inside and outside the work environment.
·What do you want to do (in regard to business function, industry, location)?
·Why the MBA? Why now?
·Describe an ethical dilemma faced at work?
·Describe your career aspirations?
·What would you do if not accepted?
·What are your long- and short-term goals? Why?
·Why are you applying to business school?
·Why does this school appeal to you?
·What is an activity you are involved in? Why is it important to you?
·Talk about experiences you have had at work.
·Why are you interested in a general MBA program?
·Why did you choose your undergraduate major?
·Discuss yourself.
·What contributions would you make to a group?
·Name three words or phrases to describe yourself to others.
·What is most frustrating at work?
·How would co-workers describe you?
·Describe a typical work day.
·Have you worked in a team environment? What were your contributions to the effort?
·Discuss any experience you have had abroad.
·How did you choose your job after college?
·What do you do to relieve stress?
·It's two years after graduation, what three words would your team members use to describe you?
·Describe a situation where you brought an idea forward, and it failed.
·How do you define success?
·What would you do if a team member wasn't pulling his own weight?
·Is there anything you would like to ask me/us?

MBA Admissions Interview Tips

General
1.Be yourself; allow your personality to shine.
2.Respond to questions honestly and candidly.
3.Understand what is asked of you. Feel free to ask for a repeat if you don't clearly understand a question.
4.Avoid the "smart-aleck" reply or the clever-flip demeanor (you know, the effort to be cute, snappy alert, falsely witty).
5.Do your homework on the school and program.
6.Be on time. Look nice.
7.Examine yourself. Know something about the MBA and how it can aid you.


Specific
1.Discuss special interests and ask how the school may help you to pursue them. For example, one representative particularly enjoyed talking to a young lady about her interest in fund-raising management.
2.Ask about faculty research and interests, especially in areas that concern you.
3.Review with representatives your work background, highlighting the benefits you received from the experiences.
4.Know something about the MBA degree and what it can do for you. Explore the possibilities of the degree as it relates to what you are seeking.
5.Inquire about the school's philosophy, approach, and direction. Since management education is young, many schools are still defining and redefining themselves in regard to what they do and how they do it.
6.Inquire about facilities (library, computer equipment), housing, and campus life. A recent graduate chose a school based on its tremendous computer laboratory.
7.If financial aid is critical to you, ask about aid sources, its availability, and the name of the person responsible for administering the program.
8.Describe to the representatives who you are: your strengths, assets, traits needing development.
9.Discuss your college work, making special reference to those courses/projects that were valuable, exciting, worthwhile, and important to your future.
10.Be frank about problems — real or perceived — without rationalizing, apologizing, blaming, or excusing. Common problems may include grades, test scores, an inconsistent record, or minimal work experience.

.NET Interview Question With Answer - Part2

11. Which namespace is the base class for .net Class library?
Ans: system.object
12. What are object pooling and connection pooling and difference?
Where do we set the Min and Max Pool size for connection pooling?
Object pooling is a COM+ service that enables you to reduce the overhead of creating each object from scratch. When an object is activated, it is pulled from the pool. When the object is deactivated, it is placed back into the pool to await the next request. You can configure object pooling by applying the ObjectPoolingAttribute attribute to a class that derives from the System.EnterpriseServices.ServicedComponent class.
Object pooling lets you control the number of connections you use, as opposed to connection pooling, where you control the maximum number reached.
Following are important differences between object pooling and connection pooling:
· Creation. When using connection pooling, creation is on the same thread, so if there is nothing in the pool, a connection is created on your behalf. With object pooling, the pool might decide to create a new object. However, if you have already reached your maximum, it instead gives you the next available object. This is crucial behavior when it takes a long time to create an object, but you do not use it for very long.
· Enforcement of minimums and maximums. This is not done in connection pooling. The maximum value in object pooling is very important when trying to scale your application. You might need to multiplex thousands of requests to just a few objects. (TPC/C benchmarks rely on this.)
COM+ object pooling is identical to what is used in .NET Framework managed SQL Client connection pooling. For example, creation is on a different thread and minimums and maximums are enforced.

13. What is Application Domain?
The primary purpose of the AppDomain is to isolate an application from other applications. Win32 processes provide isolation by having distinct memory address spaces. This is effective, but it is expensive and doesn't scale well. The .NET runtime enforces AppDomain isolation by keeping control over the use of memory - all memory in the AppDomain is managed by the .NET runtime, so the runtime can ensure that AppDomains do not access each other's memory.
Objects in different application domains communicate either by transporting copies of objects across application domain boundaries, or by using a proxy to exchange messages.
MarshalByRefObject is the base class for objects that communicate across application domain boundaries by exchanging messages using a proxy. Objects that do not inherit from MarshalByRefObject are implicitly marshal by value. When a remote application references a marshal by value object, a copy of the object is passed across application domain boundaries.
How does an AppDomain get created?
AppDomains are usually created by hosts. Examples of hosts are the Windows Shell, ASP.NET and IE. When you run a .NET application from the command-line, the host is the Shell. The Shell creates a new AppDomain for every application.
AppDomains can also be explicitly created by .NET applications. Here is a C# sample which creates an AppDomain, creates an instance of an object inside it, and then executes one of the object's methods. Note that you must name the executable 'appdomaintest.exe' for this code to work as-is.
using System;
using System.Runtime.Remoting;

public class CAppDomainInfo : MarshalByRefObject
{
public string GetAppDomainInfo()
{
return "AppDomain = " + AppDomain.CurrentDomain.FriendlyName;
}
}
public class App
{
public static int Main()
{
AppDomain ad = AppDomain.CreateDomain( "Andy's new domain", null, null );
ObjectHandle oh = ad.CreateInstance( "appdomaintest", "CAppDomainInfo" );
CAppDomainInfo adInfo = (CAppDomainInfo)(oh.Unwrap());
string info = adInfo.GetAppDomainInfo();
Console.WriteLine( "AppDomain info: " + info );
return 0;
}
}
14. What is serialization in .NET? What are the ways to control serialization?
Serialization is the process of converting an object into a stream of bytes. Deserialization is the opposite process of creating an object from a stream of bytes. Serialization/Deserialization is mostly used to transport objects (e.g. during remoting), or to persist objects (e.g. to a file or database).Serialization can be defined as the process of storing the state of an object to a storage medium. During this process, the public and private fields of the object and the name of the class, including the assembly containing the class, are converted to a stream of bytes, which is then written to a data stream. When the object is subsequently deserialized, an exact clone of the original object is created.
· Binary serialization preserves type fidelity, which is useful for preserving the state of an object between different invocations of an application. For example, you can share an object between different applications by serializing it to the clipboard. You can serialize an object to a stream, disk, memory, over the network, and so forth. Remoting uses serialization to pass objects "by value" from one computer or application domain to another.
· XML serialization serializes only public properties and fields and does not preserve type fidelity. This is useful when you want to provide or consume data without restricting the application that uses the data. Because XML is an open standard, it is an attractive choice for sharing data across the Web. SOAP is an open standard, which makes it an attractive choice.
There are two separate mechanisms provided by the .NET class library - XmlSerializer and SoapFormatter/BinaryFormatter. Microsoft uses XmlSerializer for Web Services, and uses SoapFormatter/BinaryFormatter for remoting. Both are available for use in your own code.
Why do I get errors when I try to serialize a Hashtable?
XmlSerializer will refuse to serialize instances of any class that implements IDictionary, e.g. Hashtable. SoapFormatter and BinaryFormatter do not have this restriction.


15.What is exception handling?
When an exception occurs, the system searches for the nearest catch clause that can handle the exception, as determined by the run-time type of the exception. First, the current method is searched for a lexically enclosing try statement, and the associated catch clauses of the try statement are considered in order. If that fails, the method that called the current method is searched for a lexically enclosing try statement that encloses the point of the call to the current method. This search continues until a catch clause is found that can handle the current exception, by naming an exception class that is of the same class, or a base class, of the run-time type of the exception being thrown. A catch clause that doesn't name an exception class can handle any exception.
Once a matching catch clause is found, the system prepares to transfer control to the first statement of the catch clause. Before execution of the catch clause begins, the system first executes, in order, any finally clauses that were associated with try statements more nested that than the one that caught the exception.
Exceptions that occur during destructor execution are worth special mention. If an exception occurs during destructor execution, and that exception is not caught, then the execution of that destructor is terminated and the destructor of the base class (if any) is called. If there is no base class (as in the case of the object type) or if there is no base class destructor, then the exception is discarded.
16. What is Assembly?
Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime with the information it needs to be aware of type implementations. To the runtime, a type does not exist outside the context of an assembly.
Assemblies are a fundamental part of programming with the .NET Framework. An assembly performs the following functions:
· It contains code that the common language runtime executes. Microsoft intermediate language (MSIL) code in a portable executable (PE) file will not be executed if it does not have an associated assembly manifest. Note that each assembly can have only one entry point (that is, DllMain, WinMain, or Main).
· It forms a security boundary. An assembly is the unit at which permissions are requested and granted.
· It forms a type boundary. Every type's identity includes the name of the assembly in which it resides. A type called MyType loaded in the scope of one assembly is not the same as a type called MyType loaded in the scope of another assembly.
· It forms a reference scope boundary. The assembly's manifest contains assembly metadata that is used for resolving types and satisfying resource requests. It specifies the types and resources that are exposed outside the assembly. The manifest also enumerates other assemblies on which it depends.
· It forms a version boundary. The assembly is the smallest versionable unit in the common language runtime; all types and resources in the same assembly are versioned as a unit. The assembly's manifest describes the version dependencies you specify for any dependent assemblies.
· It forms a deployment unit. When an application starts, only the assemblies that the application initially calls must be present. Other assemblies, such as localization resources or assemblies containing utility classes, can be retrieved on demand. This allows applications to be kept simple and thin when first downloaded.
· It is the unit at which side-by-side execution is supported.
Assemblies can be static or dynamic. Static assemblies can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on). Static assemblies are stored on disk in PE files. You can also use the .NET Framework to create dynamic assemblies, which are run directly from memory and are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed.
There are several ways to create assemblies. You can use development tools, such as Visual Studio .NET, that you have used in the past to create .dll or .exe files. You can use tools provided in the .NET Framework SDK to create assemblies with modules created in other development environments. You can also use common language runtime APIs, such as Reflection.Emit, to create dynamic assemblies.

17.What are the contents of assembly?
In general, a static assembly can consist of four elements:
· The assembly manifest, which contains assembly metadata.
· Type metadata.
· Microsoft intermediate language (MSIL) code that implements the types.
· A set of resources.

18.What are the different types of assemblies?
Private, Public/Shared, Satellite

19.What is the difference between a private assembly and a shared assembly?
0. Location and visibility: A private assembly is normally used by a single application, and is stored in the application's directory, or a sub-directory beneath. A shared assembly is normally stored in the global assembly cache, which is a repository of assemblies maintained by the .NET runtime. Shared assemblies are usually libraries of code which many applications will find useful, e.g. the .NET framework classes.
1. Versioning: The runtime enforces versioning constraints only on shared assemblies, not on private assemblies.

20.What are Satellite Assemblies? How you will create this? How will you get the different language strings?
Satellite assemblies are often used to deploy language-specific resources for an application. These language-specific assemblies work in side-by-side execution because the application has a separate product ID for each language and installs satellite assemblies in a language-specific subdirectory for each language. When uninstalling, the application removes only the satellite assemblies associated with a given language and .NET Framework version. No core .NET Framework files are removed unless the last language for that .NET Framework version is being removed.
(For example, English and Japanese editions of the .NET Framework version 1.1 share the same core files. The Japanese .NET Framework version 1.1 adds satellite assemblies with localized resources in a \ja subdirectory. An application that supports the .NET Framework version 1.1, regardless of its language, always uses the same core runtime files.)
http://www.ondotnet.com/lpt/a/2637
**

.NET Interview Question With Answer - Part1

1. What is .NET Framework?
The .NET Framework has two main components: the common language runtime and the .NET Framework class library.
You can think of the runtime as an agent that manages code at execution time, providing core services such as memory management, thread management, and remoting, while also enforcing strict type safety and other forms of code accuracy that ensure security and robustness.
The class library, is a comprehensive, object-oriented collection of reusable types that you can use to develop applications ranging from traditional command-line or graphical user interface (GUI) applications to applications based on the latest innovations provided by ASP.NET, such as Web Forms and XML Web services.

2. What is CLR, CTS, CLS?
The .NET Framework provides a runtime environment called the Common Language Runtime or CLR (similar to the Java Virtual Machine or JVM in Java), which handles the execution of code and provides useful services for the implementation of the program. CLR takes care of code management at program execution and provides various beneficial services such as memory management, thread management, security management, code verification, compilation, and other system services. The managed code that targets CLR benefits from useful features such as cross-language integration, cross-language exception handling, versioning, enhanced security, deployment support, and debugging.
Common Type System (CTS) describes how types are declared, used and managed in the runtime and facilitates cross-language integration, type safety, and high performance code execution.
The CLS is simply a specification that defines the rules to support language integration in such a way that programs written in any language, yet can interoperate with one another, taking full advantage of inheritance, polymorphism, exceptions, and other features. These rules and the specification are documented in the ECMA proposed standard document, "Partition I Architecture", http://msdn.microsoft.com/net/ecma/

3. What are the new features of Framework 1.1 ?
1. Native Support for Developing Mobile Web Applications
2. Enable Execution of Windows Forms Assemblies Originating from the Internet
Assemblies originating from the Internet zone—for example, Microsoft Windows® Forms controls embedded in an Internet-based Web page or Windows Forms assemblies hosted on an Internet Web server and loaded either through the Web browser or programmatically using the System.Reflection.Assembly.LoadFrom() method—now receive sufficient permission to execute in a semi-trusted manner. Default security policy has been changed so that assemblies assigned by the common language runtime (CLR) to the Internet zone code group now receive the constrained permissions associated with the Internet permission set. In the .NET Framework 1.0 Service Pack 1 and Service Pack 2, such applications received the permissions associated with the Nothing permission set and could not execute.
3. Enable Code Access Security for ASP.NET Applications
Systems administrators can now use code access security to further lock down the permissions granted to ASP.NET Web applications and Web services. Although the operating system account under which an application runs imposes security restrictions on the application, the code access security system of the CLR can enforce additional restrictions on selected application resources based on policies specified by systems administrators. You can use this feature in a shared server environment (such as an Internet service provider (ISP) hosting multiple Web applications on one server) to isolate separate applications from one another, as well as with stand-alone servers where you want applications to run with the minimum necessary privileges.
4. Native Support for Communicating with ODBC and Oracle Databases
5. Unified Programming Model for Smart Client Application Development
The Microsoft .NET Compact Framework brings the CLR, Windows Forms controls, and other .NET Framework features to small devices. The .NET Compact Framework supports a large subset of the .NET Framework class library optimized for small devices.
6. Support for IPv6
The .NET Framework 1.1 supports the emerging update to the Internet Protocol, commonly referred to as IP version 6, or simply IPv6. This protocol is designed to significantly increase the address space used to identify communication endpoints in the Internet to accommodate its ongoing growth.
http://msdn.microsoft.com/netframework/technologyinfo/Overview/whatsnew.aspx

4. Is .NET a runtime service or a development platform?
Ans: It's both and actually a lot more. Microsoft .NET includes a new way of delivering software and services to businesses and consumers. A part of Microsoft.NET is the .NET Frameworks. The .NET frameworks SDK consists of two parts: the .NET common language runtime and the .NET class library. In addition, the SDK also includes command-line compilers for C#, C++, JScript, and VB. You use these compilers to build applications and components. These components require the runtime to execute so this is a development platform.

5. What is MSIL, IL?
When compiling to managed code, the compiler translates your source code into Microsoft intermediate language (MSIL), which is a CPU-independent set of instructions that can be efficiently converted to native code. MSIL includes instructions for loading, storing, initializing, and calling methods on objects, as well as instructions for arithmetic and logical operations, control flow, direct memory access, exception handling, and other operations. Microsoft intermediate language (MSIL) is a language used as the output of a number of compilers and as the input to a just-in-time (JIT) compiler. The common language runtime includes a JIT compiler for converting MSIL to native code.

6. Can I write IL programs directly?
Yes. this simple example to the DOTNET mailing list:
.assembly MyAssembly {}
.class MyApp {
.method static void Main() {
.entrypoint
ldstr "Hello, IL!"
call void System.Console::WriteLine(class System. Object)
ret
}
}
Just put this into a file called hello.il, and then run ilasm hello.il. An exe assembly will be generated.
Can I do things in IL that I can't do in C#?
Yes. A couple of simple examples are that you can throw exceptions that are not derived from System.Exception, and you can have non-zero-based arrays.

7. What is JIT (just in time)? how it works?
Before Microsoft intermediate language (MSIL) can be executed, it must be converted by a .NET Framework just-in-time (JIT) compiler to native code, which is CPU-specific code that runs on the same computer architecture as the JIT compiler.
Rather than using time and memory to convert all the MSIL in a portable executable (PE) file to native code, it converts the MSIL as it is needed during execution and stores the resulting native code so that it is accessible for subsequent calls.
The runtime supplies another mode of compilation called install-time code generation. The install-time code generation mode converts MSIL to native code just as the regular JIT compiler does, but it converts larger units of code at a time, storing the resulting native code for use when the assembly is subsequently loaded and executed.
As part of compiling MSIL to native code, code must pass a verification process unless an administrator has established a security policy that allows code to bypass verification. Verification examines MSIL and metadata to find out whether the code can be determined to be type safe, which means that it is known to access only the memory locations it is authorized to access.

8. What is strong name?
A name that consists of an assembly's identity—its simple text name, version number, and culture information (if provided)—strengthened by a public key and a digital signature generated over the assembly.

9. What is portable executable (PE)?
The file format defining the structure that all executable files (EXE) and Dynamic Link Libraries (DLL) must use to allow them to be loaded and executed by Windows. PE is derived from the Microsoft Common Object File Format (COFF). The EXE and DLL files created using the .NET Framework obey the PE/COFF formats and also add additional header and data sections to the files that are only used by the CLR. The specification for the PE/COFF file formats is available at http://www.microsoft.com/whdc/hwdev/hardware/pecoffdown.mspx

10. What is Event - Delegate?
Clear syntax for writing a event delegate
The event keyword lets you specify a delegate that will be called upon the occurrence of some "event" in your code. The delegate can have one or more associated methods that will be called when your code indicates that the event has occurred. An event in one program can be made available to other programs that target the .NET Framework Common Language Runtime.
// keyword_delegate.cs
// delegate declaration
delegate void MyDelegate(int i);
class Program
{
public static void Main()
{
TakesADelegate(new MyDelegate(DelegateFunction));
}
public static void TakesADelegate(MyDelegate SomeFunction)
{
SomeFunction(21);
}
public static void DelegateFunction(int i)
{
System.Console.WriteLine("Called by delegate with number: {0}.", i);
}
}

COM Interview Question

What is IUnknown?
What methods are provided by IUnknown?
What should QueryInterface functions do if requested object was not found?
How can would you create an instance of the object in COM?
What happens when client calls CoCreateInstance?
What the limitations of CoCreateInstance?
What is aggregation?
What is a moniker ?
What’s the difference between COM and DCOM?
What is ROT and GIT ?
What is VARIANT?
What is __declspec(novtable)? Why would you need this?
What is In-proc?
What is OLE?Give examples of OLE usage.
Is .doc document a compound document?

Linux/Unix Interview Question with Answer

1. Q. How do you list files in a directory?
A. ls - list directory contents
ls �l (-l use a long listing format)

2. Q. How do you list all files in a directory, including the hidden files?
A. ls -a (-a, do not hide entries starting with .)

3. Q. How do you find out all processes that are currently running?
A. ps -f (-f does full-format listing.)

4. Q. How do you find out the processes that are currently running or a particular user?
A. ps -au Myname (-u by effective user ID (supports names)) (a - all users)

5. Q. How do you kill a process?
A. kill -9 8 (process_id or kill -9 %7 (job number 7)
kill -9 -1 (Kill all processes you can kill.)
killall - kill processes by name most (useful - killall java)


6. Q. What would you use to view contents of the file?
A. less filename
cat filename
pg filename
pr filename
more filename
most useful is command: tail file_name - you can see the end of the log file.

7. Q. What would you use to edit contents of the file?
A. vi screen editor or jedit, nedit or ex line editor

8. Q. What would you use to view contents of a large error log file?
A. tail -10 file_name ( last 10 rows)

9. Q. How do you log in to a remote Unix box?
A. Using telnet server_name or ssh -l ( ssh - OpenSSH SSH client (remote login program))

10.Q. How do you get help on a UNIX terminal?
A. man command_name
info command_name (more information)

11.Q. How do you list contents of a directory including all of its
subdirectories, providing full details and sorted by modification time?
A. ls -lac
-a all entries
-c by time

12.Q. How do you create a symbolic link to a file (give some reasons of doing so)?
A. ln /../file1 Link_name
Links create pointers to the actual files, without duplicating the contents of
the files. That is, a link is a way of providing another name to the same file.
There are two types of links to a file:Hard link, Symbolic (or soft) link;

13.Q. What is a filesystem?
A. Sum of all directories called file system.
A file system is the primary means of file storage in UNIX.
File systems are made of inodes and superblocks.

14.Q. How do you get its usage (a filesystem)?
A. By storing and manipulate files.

15.Q. How do you check the sizes of all users� home directories (one command)?
A. du -s
df

The du command summarizes disk usage by directory. It recurses through all subdirectories and shows disk usage by each subdirectory with a final total at the end.

Q. in current directory
A. ls -ps (p- directory; s - size)

16.Q. How do you check for processes started by user 'pat'?

A. ps -fu pat (-f -full_format u -user_name )

17.Q. How do you start a job on background?

A. bg %4 (job 4)

18 Q. What utility would you use to replace a string '2001' for '2002' in a text file?

A. Grep, Kde( works on Linux and Unix)

19. Q. What utility would you use to cut off the first column in a text file?
A. awk, kde

20. Q. How to copy file into directory?
A. cp /tmp/file_name . (dot mean in the current directory)

21. Q. How to remove directory with files?
A. rm -rf directory_name

22. Q. What is the difference between internal and external commands?
A. Internal commands are stored in the; same level as the operating system while external
commands are stored on the hard disk among the other utility programs.

23. Q. List the three main parts of an operating system command:
A. The three main parts are the command, options and arguments.

24 Q. What is the difference between an argument and an option (or switch)?
A. An argument is what the command should act on: it could be a filename,
directory or name. An option is specified when you want to request additional
information over and above the basic information each command supplies.

25. Q. What is the purpose of online help?
A. Online help provides information on each operating system command, the
syntax, the options, the arguments with descriptive information.
26. Q. Name two forms of security.
A. Two forms of security are Passwords and File Security with permissions specified.

27. Q. What command do you type to find help about the command who?
A. $ man who

28. Q. What is the difference between home directory and working directory?
A. Home directory is the directory you begin at when you log into the
system. Working directory can be anywhere on the system and it is where you are currently
working.

29. Q. Which directory is closer to the top of the file system tree, parent directory or current directory?
A. The parent directory is above the current directory, so it is closer to
the root or top of the
file system.

30. Q. Given the following pathname:
$ /business/acctg/payable/supplier/april
a) If you were in the directory called acctg, what would be the relative
pathname name for the file called april?
b) What would be the absolute pathname for april?
A.
a) $ payable/supplier/april
b) $ /business/acctg/payable/supplier/april

31. Q. Suppose your directory had the following files:
help. 1 help.2 help.3 help.4 help.O1 help.O2
aid.O1 aid.O2 aid.O3 back. 1 back.2 back.3
a) What is the command to list all files ending in 2?
b) What is the command to list all files starting in aid?
c) What is the command to list all "help" files with one character extension?
A.
a) ls *2
b) ls aid.*
c) ls help.?

32. Q. What are two subtle differences in using the more and the pg commands?
A. With the more command you display another screenful by pressing
the spacebar, with pg you press the return key.
The more command returns you automatically to the UNIX
shell when completed, while pg waits until you press return.

33. Q. When is it better to use the more command rather than cat command?
A. It is sometimes better to use the more command when you are viewing
a file that will display over one screen.

34. Q. What are two functions the move mv command can carry out?
A. The mv command moves files and can also be used to rename a file or directory.

35. Q. Name two methods you could use to rename a file.
A. Two methods that could be used:
a. use the mv command
b. copy the file and give it a new name and then remove the original file if no longer needed.

36. The soccer league consists of boy and girl teams. The boy file names begin
with B, the girl teams begin with G. All of these files are in one directory
called "soccer", which is your current directory:
Bteam.abc Bteam.OOl Bteam.OO2 Bteam.OO4
Gteam.win Gteam.OOl Gteam.OO2 Gteam.OO3
Write the commands to do the following:
a) rename the file Bteam.abc to Bteam.OO3.
b) erase the file Gteam. win after you have viewed the contents of the file
c) make a directory for the boy team files called "boys", and one for the girl team files
called" girls"
d) move all the boy teams into the "boys" directory
e) move all the girl teams into the "girls" directory
f) make a new file called Gteam.OO4 that is identical to Gteam.OOl
g) make a new file called Gteam.OO5 that is identical to Bteam.OO2
A.
a) mv Bteam.abc Bteam.OO3.
b) cat Gteam.win -or- more Gteam.win
rm Gteam. win
c) mkdir boys
mkdir girls
d) mv Bteam* boys
e) mv Gteam* girls
f) cd girls
cp Gteam.OO1 Gteam.OO4
g) There are several ways to do this. Remember that we are currently in the directory
/soccer/girls.
cp ../boys/Bteam.OO2 Gteam.OO5
or
cd ../boys
cp Bteam.OO2 ../girls/Gteam.OO5


37. Q. Draw a picture of the final directory structure for the "soccer"
directory, showing all the files and directories.


38. Q. What metacharacter is used to do the following:
1.1 Move up one level higher in the directory tree structure
1.2 Specify all the files ending in .txt
1.3 Specify one character
1.4 Redirect input from a file
1.5 Redirect the output and append it to a file
A.
1. 1.1 double-dot or ..
1.2 asterisk or *
1.3 question or ?
1.4 double greater than sign: >>
1.5 the less than sign or <

39. Q. List all the files beginning with A
A. To list all the files beginning with A command: ls A*


40. Q. Which of the quoting or escape characters allows the dollar sign ($) to retain its special meaning?
A. The double quote (") allows the dollar sign ($) to retain its special meaning.
Both the backslash (\) and single quote (') would remove the special meaning of the dollar sign.

41. Q. What is a faster way to do the same command?
mv fileO.txt newdir
mv filel.txt newdir
mv file2.txt newdir
mv file3.txt newdir
A. A shortcut method would be: mv file?.txt newdir


42. Q. List two ways to create a new file:
A.
a. Copy a file to make a new file.
b. Use the output operator e.g. ls -l > newfile.txt

43. Q. What is the difference between > and >> operators?
A. The operator > either overwrites the existing file (WITHOUT WARNING) or creates a new file.
The operator >> either adds the new contents to the end of an existing file or creates a new file.

44. Write the command to do the following:
44.1 Redirect the output from the directory listing to a printer.
44.2 Add the file efg.txt to the end of the file abc.txt.
44.3 The file testdata feeds information into the file called program
44.4 Observe the contents of the file called xyz.txt using MORE.
44.5 Observe a directory listing that is four screens long.
A.
44.1 ls > lpr
44.2 cat efg.txt >> abc.txt
44.3 program < testdata
44.4 more < xyz.txt
44.5 ls > dirsave | more



45. Q. How do you estimate file space usage
A. Use du command (Summarize disk usage of each FILE, recursively for
directories.) Good to use arguments du -hs
(-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
(-s, --summarize display only a total for each argument)

46. Q. How can you see all mounted drives?
A. mount -l

47. Q. How can you find a path to the file in the system?
A. locate file_name (locate - list files in databases that match a pattern)

48. Q. What Linux HotKeys do you know?
A. Ctrl-Alt-F1 Exit to command prompt
Ctrl-Alt-F7 or F8 Takes you back to KDE desktop from command prompt
Crtl-Alt-Backspace Restart XWindows
Ctrl-Alt-D Show desktop

49. Q. What can you tell about the tar Command?
A. The tar program is an immensely useful archiving utility. It can combine
an entire directory tree into one large file suitable for transferring or
compression.

50. Q. What types of files you know?
A. Files come in eight flavors:
Normal files
Directories
Hard links
Symbolic links
Sockets
Named pipes
Character devices
Block devices

51. Q. How to copy files from on PC to another on the same network
A. Use the following command:scp yur_file you_login@your_IP
example: copy .conf file from your PC to alex computer-
scp /etc/X11/xorg.conf alex@10.0.10.169:

52. Q. Please describe information below:

-rw-rw-r-- 1 dotpc dotpc 102 Jul 18 2003 file.buf
drwxr-xr-x 9 dotpc dotpc 4096 Oct 21 09:34 bin
lrwxrwxrwx 1 dotpc dotpc 20 Mar 21 15:00 client -> client-2.9.5
drwxrwxr-x 11 dotpc dotpc 4096 Sep 2 2005 client-2.8.9
drwxrwxr-x 7 dotpc dotpc 4096 Dec 14 12:13 data
drwxr-xr-x 12 dotpc dotpc 4096 Oct 21 09:41 docs
drwxr-xr-x 5 dotpc dotpc 4096 Dec 7 14:22 etc
drwxr-xr-x 11 dotpc dotpc 4096 Mar 21 15:54 client-2.9.5
-rw-r--r-- 1 dotpc dotpc 644836 Mar 22 09:53 client-2.9.5.tar.gz

A. This is a result of command $ls -l
we have two files, 6 directories and one link to client-2.9.5 directory.
There is number of files in every directory, size and data of last change.


53. Q. If you would like to run two commands in sequence what operators you can use?

A. ; or && the difference is:
if you separate commands with ; second command will be run automatically.
if you separate commands with && second command will be run only in the case
the first was run successfully.

54. Q. How you will uncompress the file?
A. Use tar command (The GNU version of the tar archiving utility):
tar -zxvf file_name.tar.gz

55. Q.How do you execute a program or script, my_script in your current directoty?
A. ./my_script

56. Q.How to find current time configuration in the file my_new.cfg
A. grep time my_new.cfg
Grep searches the named input files (or standard input if
no files are named, or the file name - is given) for lines
containing a match to the given pattern.

Q. What does grep() stand for?
A. General Regular Expression Parser.

57. Q. What does the top command display?
A. Top provides an ongoing look at processor activity in real
time. It displays a listing of the most CPU-intensive
tasks on the system, and can provide an interactive inter­
face for manipulating processes. (q is to quit)

58. Q. How can you find configuration on linux?
A. by using /sin/ifconfig
If no arguments are given, ifconfig displays the status of the cur-
rently active interfaces. If a single interface argument is given, it displays the status of the given interface only; if a single -a argu-
ment is given, it displays the status of all interfaces, even those
that are down. Otherwise, it configures an interface.

59. Q. How to find difference in two configuration files on the same server?
A. Use diff command that is compare files line by line
diff -u /usr/home/my_project1/etc/ABC.conf /usr/home/my_project2/etc/ABC.conf

60. Q. What is the best way to see the end of a logfile.log file?
A. Use tail command - output the last part of files
tail -n file_name ( the last N lines, instead of the last 10 as default)

Core Java Interview Questions & answer

  • Core Java Interview Questions & answer- 6


  • Core Java Interview Questions & answer- 5


  • Core Java Interview Questions & answer- 4


  • Core Java Interview Questions & answer- 3


  • Core Java Interview Questions & answer- 2


  • Core Java Interview Questions & answer- 1
  • Core Java Interview Questions & answer- 6

    What is the range of the char type?
    The range of the char type is 0 to 2^16 - 1.

    What is the range of the short type?
    The range of the short type is -(2^15) to 2^15 - 1.

    Why isn't there operator overloading?
    Because C++ has proven by example that operator overloading makes code almost impossible to maintain.

    What does it mean that a method or field is "static"?
    Static variables and methods are instantiated only once per class. In other words they are class variables, not instance variables. If you change the value of a static variable in a particular object, the value of that variable changes for all instances of that class.
    Static methods can be referenced with the name of the class rather than the name of a particular object of the class (though that works too). That's how library methods like System.out.println() work. out is a static field in the java.lang.System class.

    Is null a keyword?
    The null value is not a keyword.

    Which characters may be used as the second character of an identifier,but not as the first character of an identifier?
    The digits 0 through 9 may not be used as the first character of an identifier but they may be used after the first character of an identifier.

    Is the ternary operator written x : y ? z or x ? y : z ?
    It is written x ? y : z.

    How is rounding performed under integer division?
    The fractional part of the result is truncated. This is known as rounding toward zero.

    If a class is declared without any access modifiers, where may the class be accessed?
    A class that is declared without any access modifiers is said to have package access. This means that the class can only be accessed by other classes and interfaces that are defined within the same package.

    Does a class inherit the constructors of its superclass?
    A class does not inherit constructors from any of its superclasses.

    Name the eight primitive Java types.
    The eight primitive types are byte, char, short, int, long, float, double, and boolean.

    What restrictions are placed on the values of each case of a switch statement?
    During compilation, the values of each case of a switch statement must evaluate to a value that can be promoted to an int value.

    What is the difference between a while statement and a do statement?
    A while statement checks at the beginning of a loop to see whether the next loop iteration should occur. A do statement checks at the end of a loop to see whether the next iteration of a loop should occur. The do statement will always execute the body of a loop at least once.

    What modifiers can be used with a local inner class?
    A local inner class may be final or abstract.

    When does the compiler supply a default constructor for a class?
    The compiler supplies a default constructor for a class if no other constructors are provided.

    If a method is declared as protected, where may the method be accessed?
    A protected method may only be accessed by classes or interfaces of the same package or by subclasses of the class in which it is declared.

    What are the legal operands of the instanceof operator?
    The left operand is an object reference or null value and the right operand is a class, interface, or array type.

    Are true and false keywords?
    The values true and false are not keywords.

    What happens when you add a double value to a String?
    The result is a String object.

    What is the diffrence between inner class and nested class?
    When a class is defined within a scope od another class, then it becomes inner class.
    If the access modifier of the inner class is static, then it becomes nested class.

    Can an abstract class be final?
    An abstract class may not be declared as final

    What is numeric promotion?
    Numeric promotion is the conversion of a smaller numeric type to a larger numeric type, so that integer and floating-point operations may take place. In numerical promotion, byte, char, and short values are converted to int values. The int values are also converted to long values, if necessary. The long and float values are converted to double values, as required

    What is the difference between a public and a non-public class?
    A public class may be accessed outside of its package. A non-public class may not be accessed outside of its package.

    To what value is a variable of the boolean type automatically initialized?
    The default value of the boolean type is false

    What is the difference between the prefix and postfix forms of the ++ operator?
    The prefix form performs the increment operation and returns the value of the increment operation. The postfix form returns the current value all of the expression and then performs the increment operation on that value.

    What restrictions are placed on method overriding?
    Overridden methods must have the same name, argument list, and return type.
    The overriding method may not limit the access of the method it overrides.
    The overriding method may not throw any exceptions that may not be thrown by the overridden method.

    Core Java Interview Questions & answer- 5

    What is a Java package and how is it used?
    A Java package is a naming context for classes and interfaces. A package is used to create a separate name space for groups of classes and interfaces. Packages are also used to organize related classes and interfaces into a single API unit and to control accessibility to these classes and interfaces.

    What modifiers may be used with a top-level class?
    A top-level class may be public, abstract, or final.

    What is the difference between an if statement and a switch statement?
    The if statement is used to select among two alternatives. It uses a boolean expression to decide which alternative should be executed. The switch statement is used to select among multiple alternatives. It uses an int expression to determine which alternative should be executed.

    What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. import java.net.* versus import java.net.Socket)?
    It makes no difference in the generated class files since only the classes that are actually used are referenced by the generated class file. There is another practical benefit to importing single classes, and this arises when two (or more) packages have classes with the same name. Take java.util.Timer and javax.swing.Timer, for example. If I import java.util.* and javax.swing.* and then try to use "Timer", I get an error while compiling (the class name is ambiguous between both packages). Let's say what you really wanted was the javax.swing.Timer class, and the only classes you plan on using in java.util are Collection and HashMap. In this case, some people will prefer to import java.util.Collection and import java.util.HashMap instead of importing java.util.*. This will now allow them to use Timer, Collection, HashMap, and other javax.swing classes without using fully qualified class names in.


    Can a method be overloaded based on different return type but same argument type ?
    No, because the methods can be called without using their return type in which case there is ambiquity for the compiler

    What happens to a static var that is defined within a method of a class ?
    Can't do it. You'll get a compilation error

    How many static init can you have ?
    As many as you want, but the static initializers and class variable initializers are executed in textual order and may not refer to class variables declared in the class whose declarations appear textually after the use, even though these class variables are in scope.

    What is the difference between method overriding and overloading?
    Overriding is a method with the same name and arguments as in a parent, whereas overloading is the same method name but different arguments

    What is constructor chaining and how is it achieved in Java ?
    A child object constructor always first needs to construct its parent (which in turn calls its parent constructor.). In Java it is done via an implicit call to the no-args constructor as the first statement.

    What is the difference between the Boolean & operator and the && operator?
    If an expression involving the Boolean & operator is evaluated, both operands are evaluated. Then the & operator is applied to the operand. When an expression involving the && operator is evaluated, the first operand is evaluated. If the first operand returns a value of true then the second operand is evaluated. The && operator is then applied to the first and second operands. If the first operand evaluates to false, the evaluation of the second operand is skipped.

    Which Java operator is right associative?
    The = operator is right associative.

    Can a double value be cast to a byte?
    Yes, a double value can be cast to a byte.

    What is the difference between a break statement and a continue statement?
    A break statement results in the termination of the statement to which it applies (switch, for, do, or while). A continue statement is used to end the current loop iteration and return control to the loop statement.

    Can a for statement loop indefinitely?
    Yes, a for statement can loop indefinitely. For example, consider the following: for(;;) ;

    To what value is a variable of the String type automatically initialized?
    The default value of an String type is null.

    What is the difference between a field variable and a local variable?
    A field variable is a variable that is declared as a member of a class. A local variable is a variable that is declared local to a method.

    How are this() and super() used with constructors?
    this() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.

    What does it mean that a class or member is final?
    A final class cannot be inherited. A final method cannot be overridden in a subclass.
    A final field cannot be changed after it's initialized, and it must include an initializer statement where it's declared.

    What does it mean that a method or class is abstract?
    An abstract class cannot be instantiated. Abstract methods may only be included in abstract classes.However, an abstract class is not required to have any abstract methods, though most of them do.Each subclass of an abstract class must override the abstract methods of its superclasses or it also shouldbe declared abstract.

    What is a transient variable?
    transient variable is a variable that may not be serialized.

    How does Java handle integer overflows and underflows?
    It uses those low order bytes of the result that can fit into the size of the type allowed by the operation.

    What is the difference between the >> and >>> operators?
    The >> operator carries the sign bit when shifting right. The >>> zero-fills bits that have been shifted out.

    Core Java Interview Questions & answer- 4

    Which OO Concept is achieved by using overloading and overriding?
    Polymorphism.

    If i only change the return type, does the method become overloaded?
    No it doesn't. There should be a change in method arguements for a method to be overloaded.

    Why does Java not support operator overloading?
    Operator overloading makes the code very difficult to read and maintain. To maintain code simplicity, Java doesn't support operator overloading.

    Can we define private and protected modifiers for variables in interfaces?
    No

    What is Externalizable?
    Externalizable is an Interface that extends Serializable Interface. And sends data into Streams in Compressed Format. It has two methods, writeExternal(ObjectOuput out) and readExternal(ObjectInput in)


    What modifiers are allowed for methods in an Interface?
    Only public and abstract modifiers are allowed for methods in interfaces.

    What is a local, member and a class variable?
    Variables declared within a method are "local" variables.
    Variables declared within the class i.e not within any methods are "member" variables (global variables).
    Variables declared within the class i.e not within any methods and are defined as "static" are class variables

    What is an abstract method?
    An abstract method is a method whose implementation is deferred to a subclass.

    What value does read() return when it has reached the end of a file?
    The read() method returns -1 when it has reached the end of a file.

    Can a Byte object be cast to a double value?
    No, an object cannot be cast to a primitive value.

    What is the difference between a static and a non-static inner class?
    A non-static inner class may have object instances that are associated with instances of the class's outer class. A static inner class does not have any object instances.

    What is an object's lock and which object's have locks?
    An object's lock is a mechanism that is used by multiple threads to obtain synchronized access to the object. A thread may execute a synchronized method of an object only after it has acquired the object's lock. All objects and classes have locks. A class's lock is acquired on the class's Class object.

    What is the % operator?
    It is referred to as the modulo or remainder operator. It returns the remainder of dividing the first operand by the second operand.

    When can an object reference be cast to an interface reference?
    An object reference be cast to an interface reference when the object implements the referenced interface.

    Which class is extended by all other classes?
    The Object class is extended by all other classes.

    Which non-Unicode letter characters may be used as the first character of an identifier?
    The non-Unicode letter characters $ and _ may appear as the first character of an identifier

    What restrictions are placed on method overloading?
    Two methods may not have the same name and argument list but different return types.

    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.

    What is the return type of a program's main() method?
    void.

    If a variable is declared as private, where may the variable be accessed?
    A private variable may only be accessed within the class in which it is declared.

    What do you understand by private, protected and public?
    These are accessibility modifiers. Private is the most restrictive, while public is the least restrictive. There is no real difference between protected and the default type (also known as package protected) within the context of the same package, however the protected keyword allows visibility to a derived class in a different package.

    What is Downcasting ?
    Downcasting is the casting from a general to a more specific type, i.e. casting down the hierarchy

    What modifiers may be used with an inner class that is a member of an outer class?
    A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.

    How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?
    Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns.

    What restrictions are placed on the location of a package statement within a source code file?
    A package statement must appear as the first line in a source code file (excluding blank lines and comments).

    What is a native method?
    A native method is a method that is implemented in a language other than Java.

    What are order of precedence and associativity, and how are they used?
    Order of precedence determines the order in which operators are evaluated in expressions. Associatity determines whether an expression is evaluated left-to-right or right-to-left

    Can an anonymous class be declared as implementing an interface and extending a class?
    An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.

    Core Java Interview Questions & answer- 3

    Can a method inside a Interface be declared as final?
    No not possible. Doing so will result in compilation error. public and abstract are the only applicable modifiers for method declaration in an interface.

    Can an Interface implement another Interface?
    Intefaces doesn't provide implementation hence a interface cannot implement another interface.

    Can an Interface extend another Interface?
    Yes an Interface can inherit another Interface, for that matter an Interface can extend more than one Interface.

    Can a Class extend more than one Class?
    Not possible. A Class can extend only one class but can implement any number of Interfaces.

    Why is an Interface be able to extend more than one Interface but a Class can't extend more than one Class?
    Basically Java doesn't allow multiple inheritance, so a Class is restricted to extend only one Class. But an Interface is a pure abstraction model and doesn't have inheritance hierarchy like classes(do remember that the base class of all classes is Object). So an Interface is allowed to extend more than one Interface.

    Can an Interface be final?
    Not possible. Doing so so will result in compilation error.

    Can a class be defined inside an Interface?
    Yes it's possible.

    Can an Interface be defined inside a class?
    Yes it's possible.

    What is a Marker Interface?
    An Interface which doesn't have any declaration inside but still enforces a mechanism.

    Core Java Interview Questions & answer- 2

    What is the purpose of declaring a variable as final?
    A final variable's value can't be changed. final variables should be initialized before using them.

    What is the impact of declaring a method as final?
    A method declared as final can't be overridden. A sub-class can't have the same method signature with a different implementation.

    I don't want my class to be inherited by any other class. What should i do?
    You should declared your class as final. But you can't define your class as final, if it is an abstract class. A class declared as final can't be extended by any other class.

    Can you give few examples of final classes defined in Java API?
    java.lang.String,java.lang.Math are final classes.

    How is final different from finally and finalize?
    final is a modifier which can be applied to a class or a method or a variable. final class can't be inherited, final method can't be overridden and final variable can't be changed.
    finally is an exception handling code section which gets executed whether an exception is raised or not by the try block code segment.
    finalize() is a method of Object class which will be executed by the JVM just before garbage collecting object to give a final chance for resource releasing activity.

    Can a class be declared as static?
    No a class cannot be defined as static. Only a method,a variable or a block of code can be declared as static.

    When will you define a method as static?
    When a method needs to be accessed even before the creation of the object of the class then we should declare the method as static.

    What are the restriction imposed on a static method or a static block of code?
    A static method should not refer to instance variables without creating an instance and cannot use "this" operator to refer the instance.

    I want to print "Hello" even before main is executed. How will you acheive that?
    Print the statement inside a static block of code. Static blocks get executed when the class gets loaded into the memory and even before the creation of an object. Hence it will be executed before the main method. And it will be executed only once.

    What is the importance of static variable?
    static variables are class level variables where all objects of the class refer to the same variable. If one object changes the value then the change gets reflected in all the objects.

    Can we declare a static variable inside a method?
    Static varaibles are class level variables and they can't be declared inside a method. If declared, the class will not compile.

    What is an Abstract Class and what is it's purpose?
    A Class which doesn't provide complete implementation is defined as an abstract class. Abstract classes enforce abstraction.

    Can a abstract class be declared final?
    Not possible. An abstract class without being inherited is of no use and hence will result in compile time error.

    What is use of a abstract variable?
    Variables can't be declared as abstract. only classes and methods can be declared as abstract.

    Can you create an object of an abstract class?
    Not possible. Abstract classes can't be instantiated.

    Can a abstract class be defined without any abstract methods?
    Yes it's possible. This is basically to avoid instance creation of the class.

    Class C implements Interface I containing method m1 and m2 declarations. Class C has provided implementation for method m2. Can i create an object of Class C?
    No not possible. Class C should provide implementation for all the methods in the Interface I. Since Class C didn't provide implementation for m1 method, it has to be declared as abstract. Abstract classes can't be instantiated.

    Core Java Interview Questions & answer- 1

    Are JVM's platform independent?
    JVM's are not platform independent. JVM's are platform specific run time implementation provided by the vendor.

    What is a JVM?
    JVM is Java Virtual Machine which is a run time environment for the compiled java class files.


    What is the difference between a JDK and a JVM?
    JDK is Java Development Kit which is for development purpose and it includes execution environment also. But JVM is purely a run time environment and hence you will not be able to compile your source files using a JVM.

    What is a pointer and does Java support pointers?
    Pointer is a reference handle to a memory location. Improper handling of pointers leads to memory leaks and reliability issues hence Java doesn't support the usage of pointers.

    What is the base class of all classes?
    java.lang.Object

    Does Java support multiple inheritance?
    Java doesn't support multiple inheritance.

    Is Java a pure object oriented language?
    Java uses primitive data types and hence is not a pure object oriented language.

    Are arrays primitive data types?
    In Java, Arrays are objects.

    What is difference between Path and Classpath?
    Path and Classpath are operating system level environment variales. Path is used define where the system can find the executables(.exe) files and classpath is used to specify the location .class files.

    What are local variables?
    Local varaiables are those which are declared within a block of code like methods. Local variables should be initialised before accessing them.

    What are instance variables?
    Instance variables are those which are defined at the class level. Instance variables need not be initialized before using them as they are automatically initialized to their default values.

    How to define a constant variable in Java?
    The variable should be declared as static and final. So only one copy of the variable exists for all instances of the class and the value can't be changed also.

    static final int PI = 2.14; is an example for constant.

    Should a main method be compulsorily declared in all java classes?
    No not required. main method should be defined only if the source class is a java application.

    What is the return type of the main method?
    Main method doesn't return anything hence declared void.

    Why is the main method declared static?
    main method is called by the JVM even before the instantiation of the class hence it is declared as static.

    What is the arguement of main method?
    main method accepts an array of String object as arguement.

    Can a main method be overloaded?
    Yes. You can have any number of main methods with different method signature and implementation in the class.

    Can a main method be declared final?
    Yes. Any inheriting class will not be able to have it's own default main method.

    Does the order of public and static declaration matter in main method?
    No it doesn't matter but void should always come before main().

    Can a source file contain more than one Class declaration?
    Yes a single source file can contain any number of Class declarations but only one of the class can be declared as public.

    What is a package?
    Package is a collection of related classes and interfaces. package declaration should be first statement in a java class.

    Which package is imported by default?
    java.lang package is imported by default even without a package declaration.

    Can a class declared as private be accessed outside it's package?
    Not possible.

    Can a class be declared as protected?
    A class can't be declared as protected. only methods can be declared as protected.

    What is the access scope of a protected method?
    A protected method can be accessed by the classes within the same package or by the subclasses of the class in any package.

    .NET OOPS

    Question: What Is OOPS ?
    Answer: OOPs is an Object Oriented Programming language,which is the extension of Procedure Oriented Programming language.OOPS reduce the code of the program because of the extensive feature of Polymorphism. OOPS have many properties such as Data-Hiding,Inheritence,Data Absraction,Data Encapsulation and many moreEverything in the world is an object. The type of the object may vary. In OOPS, we get the power to create objects of our own, as & when required.

    Question: what is Class ?
    Answer:A group of objects that share a common definition and that therefore share common properties, operations, and behavior. A user-defined type that is defined with the class-key 'class,' 'struct,' or 'union.' Objects of a class type consist of zero or more members and base class objects.Classes can be defined hierarchically, allowing one class to be an expansion of another, and classes can restrict access to their members.

    Question: What is Constructor?
    Answer:When we create instance of class a special method of that class, called that is constructor. Similarly, when the class is destroyed, the destructor method is called. These are general terms and usually not the actual member names in most object-oriented languages. It is initialized using the keyword New, and is destroyed using the keyword Finalize.

    Question: What is Abstract Class ?
    Answer:Classes that cannot be instantiated. We cannot create an object from such a class for use in our program. We can use an abstract class as a base class, creating new classes that will inherit from it. Creating an abstract class with a certain minimum required level of functionality gives us a defined starting point from which we can derive non-abstract classes. An abstract class may contain abstract methods & non-abstract methods. When a class is derived from an abstract class, the derived class must implement all the abstract methods declared in the base class. We may use accessibility modifiers in an abstract class.An abstract class can inherit from a non-abstract class. In C++, this concept is known as pure virtual method.

    Question: What is ValueType?
    Answer:Value Types - Value types are primitive types. Like Int32 maps to System.Int32, double maps to System.double.All value types are stored on stack and all the value types are derived from System.ValueType. All structures and enumerated types that are derived from System.ValueType are created on stack, hence known as ValueType.In value type we create a copy of object and uses there value its not the original one.

    Question: What is diff. between abstract class and an interface?
    Answer: An abstract class and Interface both have method only but not have body of method.The difference between Abstract class and An Interface is that if u call Ablstract class then u have to call all method of that particular Abstract class but if u call an Interface then it is not necessary that u call all method of that particular interface.Method OverLoading:-Return type, Parameter type, parameter and body of method number may be different.Method Overriding:- Return type, Parameter type, Parameter Number all must be same . Only body of method can change.

    101 Typical Job Interview Questions

    1. How would you describe yourself?
    2. What specific goals, including those related to your occupation, have you established for your life?
    3. How has your college experience prepared you for a business career?
    4. Please describe the ideal job for you following graduation.
    5. What influenced you to choose this career?
    6. At what point did you choose this career?
    7. What specific goals have you established for your career?
    8. What will it take to attain your goals, and what steps have you taken toward attaining them?
    9. What do you think it takes to be successful in this career?
    10. How do you determine or evaluate success? Give me an example of one of your successful accomplishments.
    11. Do you have the qualifications and personal characteristics necessary for success in your chosen career?
    12. What has been your most rewarding accomplishment?
    13. If you could do so, how would you plan your college career differently?
    14. Are you more energized by working with data or by collaborating with other individuals?
    15. How would you describe yourself in terms of your ability to work as a member of a team?
    16. What motivates you to put forth your greatest effort?
    17. Given the investment our company will make in hiring and training you, can you give us a reason to hire you?
    18. Would you describe yourself as goal-driven?
    19. Describe what you've accomplished toward reaching a recent goal for yourself.
    20. What short-term goals and objectives have you established for yourself?
    21. Can you describe your long-range goals and objectives?
    22. What do you expect to be doing in five years?
    23. What do you see yourself doing in ten years?
    24. How would you evaluate your ability to deal with conflict?
    25. Have you ever had difficulty with a supervisor or instructor? How did you resolve the conflict?
    26. Tell me about a major problem you recently handled. Were you successful in resolving it?
    27. Would you say that you can easily deal with high-pressure situations?
    28. What quality or attribute do you feel will most contribute to your career success?
    29. What personal weakness has caused you the greatest difficulty in school or on the job?
    30. What were your reasons for selecting your college or university?
    31. If you could change or improve anything about your college, what would it be?
    32. How will the academic program and coursework you've taken benefit your career?
    33. Which college classes or subjects did you like best? Why?
    34. Are you the type of student for whom conducting independent research has been a positive experience?
    35. Describe the type of professor that has created the most beneficial learning experience for you.
    36. Do you think that your grades are a indication of your academic achievement?
    37. What plans do you have for continued study? An advanced degree?
    38. Before you can make a productive contribution to the company, what degree of training do you feel you will require?
    39. Describe the characteristics of a successful manager.
    40. Why did you decide to seek a position in this field?
    41. Tell me what you know about our company.
    42. Why did you decide to seek a position in this company?
    43. Do you have a geographic preference?
    44. Why do you think you might like to live in the community in which our company is located?
    45. Would it be a problem for you to relocate?
    46. To what extent would you be willing to travel for the job?
    47. Which is more important to you, the job itself or your salary?
    48. What level of compensation would it take to make you happy?
    49. Tell me about the salary range you're seeking.
    50. Describe a situation in which you were able to use persuasion to successfully convince someone to see things your way?
    51. Describe an instance when you had to think on your feet to extricate yourself from a difficult situation.
    52. Give me a specific example of a time when you used good judgment and logic in solving a problem.
    53. By providing examples, convince me that you can adapt to a wide variety of people, situations and environments.
    54. Describe a time when you were faced with problems or stresses that tested your coping skills.
    55. Give an example of a time in which you had to be relatively quick in coming to a decision.
    56. Describe a time when you had to use your written communication skills to get an important point across
    57. Give me a specific occasion in which you conformed to a policy with which you did not agree.
    58. Give me an example of an important goal which you had set in the past and tell me about your success in reaching it.
    59. Describe the most significant or creative presentation that you have had to complete.
    60. Tell me about a time when you had to go above and beyond the call of duty in order to get a job done.
    61. Give me an example of a time when you were able to successfully communicate with another person even when that individual may not have personally liked you (or vice versa).
    62. Sometimes it's easy to get in "over your head." Describe a situation where you had to request help or assistance on a project or assignment.
    63. Give an example of how you applied knowledge from previous coursework to a project in another class.
    64. Describe a situation where others you were working with on a project disagreed with your ideas. What did you do?
    65. Describe a situation in which you found that your results were not up to your professor's or supervisor's expectations. What happened? What action did you take?
    66. Tell of a time when you worked with a colleague who was not completing his or her share of the work. Who, if anyone, did you tell or talk to about it? Did the manager take any steps to correct your colleague? Did you agree or disagree with the manager's actions?
    67. Describe a situation in which you had to arrive at a compromise or guide others to a compromise.
    68. What steps do you follow to study a problem before making a decision.
    69. We can sometimes identify a small problem and fix it before it becomes a major problem. Give an example(s) of how you have done this.
    70. In a supervisory or group leader role, have you ever had to discipline or counsel an employee or group member? What was the nature of the discipline? What steps did you take? How did that make you feel? How did you prepare yourself?
    71. Recall a time from your work experience when your manager or supervisor was unavailable and a problem arose. What was the nature of the problem? How did you handle that situation? How did that make you feel?
    72. Recall a time when you were assigned what you considered to be a complex project. Specifically, what steps did you take to prepare for and finish the project? Were you happy with the outcome? What one step would you have done differently if given the chance?
    73. What was the most complex assignment you have had? What was your role?
    74. How was your transition from high school to college? Did you face any particular problems?
    75. Tell of some situations in which you have had to adjust quickly to changes over which you had no control. What was the impact of the change on you?
    76. Compare and contrast the times when you did work which was above the standard with times your work was below the standard.
    77. Describe some times when you were not very satisfied or pleased with your performance. What did you do about it?
    78. What are your standards of success in school? What have you done to meet these standards?
    79. How have you differed from your professors in evaluating your performance? How did you handle the situation?
    80. Give examples of your experiences at school or in a job that were satisfying. Give examples of your experiences that were dissatisfying.
    81. What kind of supervisor do you work best for? Provide examples.
    82. Describe some projects or ideas (not necessarily your own) that were implemented, or carried out successfully primarily because of your efforts.
    83. Describe a situation that required a number of things to be done at the same time. How did you handle it? What was the result?
    84. Have you found any ways to make school or a job easier or more rewarding or to make yourself more effective?
    85. How do you determine priorities in scheduling your time? Give examples.
    86. Tell of a time when your active listening skills really paid off for you - maybe a time when other people missed the key idea being expressed.
    87. What has been your experience in giving presentations? What has been your most successful experience in speech making?
    88. Tell of the most difficult customer service experience that you have ever had to handle -- perhaps an angry or irate customer. Be specific and tell what you did and what was the outcome.
    89. Give an example of when you had to work with someone who was difficult to get along with. Why was this person difficult? How did you handle that person?
    90. Describe a situation where you found yourself dealing with someone who didn't like you. How did you handle it?
    91. Give me a specific example of something you did that helped build enthusiasm in others.
    92. Tell me about a difficult situation when it was desirable for you to keep a positive attitude. What did you do?
    93. Give me an example of a time you had to make an important decision. How did you make the decision? How does it affect you today?
    94. Give me an example of a time you had to persuade other people to take action. Were you successful?
    95. Tell me about a time when you had to deal with a difficult person. How did you handle the situation?
    96. Tell me about a time you had to handle multiple responsibilities. How did you organize the work you needed to do?
    97. Tell me about a time when you had to make a decision, but didn't have all the information you needed.
    98. What suggestions do you have for our organization?
    99. What is the most significant contribution you made to the company during a past job or internship?
    100. What is the biggest mistake you've made?
    101. Describe a situation in which you had to use reference materials to write a research paper. What was the topic? What journals did you read?

    Networks and Security

    1. How do you use RSA for both authentication and secrecy?

    2. What is ARP and how does it work?

    3. What's the difference between a switch and a router?

    4. Name some routing protocols? (RIP,OSPF etc..)

    5. How do you do authentication with message digest(MD5)? (Usually MD is used for finding tampering of data)

    6. How do you implement a packet filter that distinguishes following cases and selects first case and rejects second case.

    i) A host inside the corporate n/w makes a ftp request to outside host and the outside host sends reply.

    ii) A host outside the network sends a ftp request to host inside. for the packet filter in both cases the source and destination fields will look the same.

    7. How does traceroute work? Now how does traceroute make sure that the packet follows the same path that a previous (with ttl - 1) probe packet went in?

    8. Explain Kerberos Protocol ?

    9. What are digital signatures and smart cards?

    10. Difference between discretionary access control and mandatory access control?

    Computer Architecture

    1. Explain what is DMA?
    2. What is pipelining?
    3. What are superscalar machines and vliw machines?
    4. What is cache?
    5. What is cache coherency and how is it eliminated?
    6. What is write back and write through caches?
    7. What are different pipelining hazards and how are they eliminated.
    8. What are different stages of a pipe?
    9. Explain more about branch prediction in controlling the control hazards
    10. Give examples of data hazards with pseudo codes.
    11. How do you calculate the number of sets given its way and size in a cache?
    12. How is a block found in a cache?
    13. Scoreboard analysis.
    14. What is miss penalty and give your own ideas to eliminate it.
    15. How do you improve the cache performance.
    16. Different addressing modes.
    17. Computer arithmetic with two's complements.
    18. About hardware and software interrupts.
    19. What is bus contention and how do you eliminate it.
    20. What is aliasing?
    21) What is the difference between a latch and a flip flop?
    22) What is the race around condition? How can it be overcome?
    23) What is the purpose of cache? How is it used?
    24) What are the types of memory management?