Home | Walkin Interviews | Interview Tips | Job Seekers Login | Recruiters Login | Job Fairs |  
 

Welcome
 
"" Keyword Search
"" Quick Search
"" Advanced Search
"" Jobs By category
 


FAQ's


• How do you link a C++ program to C functions?
By using the extern "C" linkage specification around the C function declarations. Programmers should know about mangled function names and type-safe linkages. Then they should explain how the extern "C" linkage specification statement turns that feature off during compilation so that the linker properly links function calls to C functions. Another acceptable answer is "I don't know. We never had to do that." Merely describing what a linker does indicates that the programmer does not understand the issue that underlies the question.
• Is it possible to have Virtual Constructor? If yes, how? If not, Why not possible ?
Virtual Constructor doesn't exist. Constructor can’t be virtual as the constructor is a code which is responsible for creating a instance of a class and it can’t be delegated to any other object by virtual keyword means.
• What is a "virtual member function"?
A virtual function allows derived classes to replace the implementation provided by the base class. The compiler makes sure the replacement is always called whenever the object in question is actually of the derived class, even if the object is accessed by a base pointer rather than a derived pointer. This allows algorithms in the base class to be replaced in the derived class, even if users don't know about the derived class. The derived class can either fully replace ("override") the base class member function, or the derived class can partially replace ("augment") the base class member function. The latter is accomplished by having the derived class member function call the base class member function, if desired.
• What are different types of inner classes?
Nested top-level classes, Member classes, Local classes, Anonymous classes Nested top-level classes- If you declare a class within a class and specify the static modifier, the compiler treats the class just like any other top-level class. Any class outside the declaring class accesses the nested class with the declaring class name acting similarly to a package. eg, outer.inner. Top-level inner classes implicitly have access only to static variables.There can also be inner interfaces. All of these are of the nested top-level variety. Member classes - Member inner classes are just like other member methods and member variables and access to the member class is restricted, just like methods and variables. This means a public member class acts similarly to a nested top-level class. The primary difference between member classes and nested top-level classes is that member classes have access to the specific instance of the enclosing class. Local classes - Local classes are like local variables, specific to a block of code. Their visibility is only within the block of their declaration. In order for the class to be useful beyond the declaration block, it would need to implement a more publicly available interface.Because local classes are not members, the modifiers public, protected, private, and static are not usable. Anonymous classes - Anonymous inner classes extend local inner classes one level further. As anonymous classes have no name, you cannot provide a constructor.
• What is Overriding?
When a class defines a method using the same name, return type, and arguments as a method in its superclass, the method in the class overrides the method in the superclass. When the method is invoked for an object of the class, it is the new definition of the method that is called, and not the method definition from superclass. Methods may be overridden to be more public, not more private.
• What is an abstract class?
Abstract class must be extended/subclassed (to be useful). It serves as a template. A class that is abstract may not be instantiated (ie, you may not call its constructor), abstract class may contain static data. Any class with an abstract method is automatically abstract itself, and must be declared as such. A class may be declared abstract even if it has no abstract methods. This prevents it from being instantiated.
• State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.
public : Public class is visible in other packages, field is visible everywhere (class must be public too) private : Private variables or methods may be used only by an instance of the same class that declares the variable or method, A private feature may only be accessed by the class that owns the feature. protected : Is available to all classes in the same package and also available to all subclasses of the class that owns the protected feature.This access is provided even to subclasses that reside in a different package from the class that owns the protected feature. default :What you get by default ie, without any access modifier (ie, public private or protected).It means that it is visible to all within a particular package.
• Difference between HashMap and HashTable?
The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls. (HashMap allows null values as key and value whereas Hashtable doesnt allow). HashMap does not guarantee that the order of the map will remain constant over time. HashMap is unsynchronized and Hashtable is synchronized.
• Q:What are pass by reference and passby value?
Pass By Reference means the passing the address itself rather than passing the value. Passby Value means passing a copy of the value to be passed.
• Q: What is the purpose of garbage collection in Java, and when is it used?
The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used.
• Q: What is the difference between an Interface and an Abstract class?
An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods. .
• How can we change priority and what the levels of priority are provided by .NET?
Thread priority can be changed by using Threadname.Priority = ThreadPriority.Highest. Following are different levels of Priority provided by .NET : ThreadPriority.Highest ThreadPriority.AboveNormal ThreadPriority.Normal ThreadPriority.BelowNormal ThreadPriority.Lowest
• What is a Thread?
A thread is the basic unit to which the opearting system allocates processor time.
• What is Multi-threading?
Multi-threading forms subset of Multi-tasking. Instead of having to switch between programs this feature switches between different parts of the same program. Example you are writing in word and at the same time word is doing a spell check in background.
• What is Multi-tasking?
It is a feature of modern operating system with which we can run multiple programs at same time. Example Word,Excel etc.
• What is Manifest?
Assembly metadata is stored in Manifest. Manifest contains all the metadata needed to do the following Version of Assembly Security identity Scope of the assembly Resolve references to resources and classes The assembly manifest can be stored in either a PE file(an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a stand-alone PE file that contains only assembly manifest information.
• What is the Difference between NameSpace and Assembly?
Assembly is physical grouping of logical units. Namspace logically groups classes. Namespace can span multiple assembly.
• What is Namespace?
Namespace has two basic functionality : Namespace Logically group types, example System.Web.UI logically groups our UI related features. In Object Oriented world many times its possible that programmers will use the same class name. By qualifying Namespace with clasname this collision can be avoided.
• What is Namespace?
.NET Namespace has two basic functionality : Namespace Logically group types, example System.Web.UI logically groups our UI related features. In Object Oriented world many times its possible that programmers will use the same class name. By qualifying Namespace with clasname this collision can be avoided.
• What are the different types of Assmbly?
There are two types of assembly Private and Public assembly. 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. Crystal report classes which will be used by all application for Reports.
• What is a Assembly?
Assembly is unit of deployment like EXE or a DLL. An Assembly consists of one or more files (dlls,exe's,html files etc.) and represents a group of resources, type definitions, and implementations of those types. An assembly may also contain references to other assemblies. These resources, types and references are described in a block of data called a manifest. The manifest is part of the assembly, thus making the assembly self-describing. An assembly is completely self-describing. An assembly contains metadata information, which is used by the CLR for everything from type checking and security to actually invoking the components methods. As all information is in the assembly itself, it is independent of registry. This is the basic advantage as compared to COM where the version was stored in registry. Multiple versions can be deployed side by side in different folders. These different versions can execute at the same time without interfering with each other. Assemblies can be private or shared. For private assembly deployment, the assembly is copied to the same directory as the client program that references it. No registration is needed, and no fancy installation program is required. When the component is removed, no registry cleanup is needed, and no unistall program is required. Just delete it from the hard drive. In shared assembly deployment, an assembly is installed in the Global Assembly \ Cache (or GAC). The GAC contains shared assemblies that are globally accessible to all .NET applications on the machine.
• What is a CTS?
In order that two language communicate smoothly CLR has CTS (Common Type System). Example in VB you have "Integer" and in C++ you have "long" these data types are not compatible so the interfacing between them is very complicated. In order to able that two different languages can communicate Microsoft introduced Common Type System. So "Integer" datatype in VB6 and "int" datatype in C++ will convert it to System.int32 which is datatype of CTS.
• What is a CLR?
CLR (Common Language Runtime) is the heart of the .NET framework. All Languages have runtime and its the responsibility of the runtime to take care of the code execution of the program. For example Java has JVM(Java Virual Machine) Similarly .NET has CLR. Following are the responsibilities of CLR Garbage Collection : CLR automatically manages memory thus eliminating memory leaks. When objects are not referred GC automatically releases those memories thus providing efficient memory management. Code Access Security : CAS grants rights to program depending on the security configuration of the machine. Example the program has rights to edit or create a new file but the security configuration of machine does not allow the program to delete a file. CAS will take care that the code runs under the environment of machines security configuration. Code Verification : This ensures proper code execution and type safety while the code runs. It prevents the source code to perform illegal operation such as accessing invalid memory locations etc. IL(Intermediate language)-to-native translators and optimizer's : CLR uses JIT and compiles the IL code to machine code and then executes. CLR also determines depending on platform what is optimized way of running the IL code.
• What is IL?
(IL)Intermediate Language is also known as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language). All .NET source code is compiled to IL. This IL is then converted to machine code at the point where the software is installed, or at run-time by a Just-In-Time (JIT) compiler.
• What is the difference between a constructor and a method?
A constructor is a member function of a class that is used to create objects of that class. It has the same name as the class itself, has no return type, and is invoked using the new operator. A method is an ordinary member function of a class. It has its own name, a return type (which may be void), and is invoked using the dot operator.
• Difference between Swing and Awt?
AWT are heavy-weight componenets. Swings are light-weight components. Hence swing works faster than AWT
• Difference between Vector and ArrayList?
Vector is synchronized whereas arraylist is not.
• Difference between HashMap and HashTable?
The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls. (HashMap allows null values as key and value whereas Hashtable doesnt allow). HashMap does not guarantee that the order of the map will remain constant over time. HashMap is unsynchronized and Hashtable is synchronized.
• What is HashMap and Map?
Map is Interface and Hashmap is class that implements that.
• What are pass by reference and passby value?
Pass By Reference means the passing the address itself rather than passing the value. Passby Value means passing a copy of the value to be passed.
• Explain different way of using thread?
The thread could be implemented by using runnable interface or by inheriting from the Thread class. The former is more advantageous, 'cause when you are going for multiple inheritance..the only interface can help.
• Describe synchronization in respect to multithreading?
With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchonization, it is possible for one thread to modify a shared variable while another thread is in the process of using or updating same shared variable. This usually leads to significant errors.
• What is the purpose of garbage collection in Java, and when is it used?
The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used.
• What is the difference between an Interface and an Abstract class?
An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.
• What are packages ? what is use of packages ?
The package statement defines a name space in which classes are stored.If you omit the package, the classes are put into the default package.
Signature... package pkg;
Use: * It specifies to which package the classes defined in a file belongs to. * Package is both naming and a visibility control mechanism.
• What are identifiers and what is naming convention?
Identifiers are used for class names, method names and variable names. An identifier may be any descriptive sequence of upper case & lower case letters,numbers or underscore or dollar sign and must not begin with numbers.
• What are the three OOPs principles and define them?
Encapsulation, Inheritance and Polymorphism are the three OOPs 
Principles.
Encapsulation:
Is the Mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse.
Inheritance:
Is the process by which one object acquires the properties of another object.
Polymorphism:
Is a feature that allows one interface to be used for a general class of actions.
• 8. What happens in memory when you Box and Unbox a value-type?
Boxing converts a value-type to a reference-type, thus storing the object on the heap.  Unboxing converts a reference-type to a value-type, thus storing the value on the stack.
• 2. What’s typical about a Windows process in regards to memory allocation?
Each process is allocated its own block of available RAM space, no process can access another process’ code or data. If the process crashes, it dies alone without taking the entire OS or a bunch of other applications down. 
• 3. Explain what relationship is between a Process, Application Domain, and Application?
A process is an instance of a running application. An application is an executable on the hard drive or network. There can be numerous processes launched of the same application (5 copies of Word running), but 1 process can run just 1 application.
• 4. What are possible implementations of distributed applications in .NET?
.NET Remoting and ASP.NET Web Services. If we talk about the Framework Class Library, noteworthy classes are in System.Runtime.Remoting and System.Web.Services. 
• 5. What are the consideration in deciding to use .NET Remoting or ASP.NET Web Services?
Remoting is a more efficient communication exchange when you can control both ends of the application involved in the communication process.  Web Services provide an open-protocol-based exchange of informaion.  Web Services are best when you need to communicate with an external organization or another (non-.NET) technology.
• 7. What are remotable objects in .NET Remoting?
Remotable objects are the objects that can be marshaled across the application domains. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed
• 8. What are channels in .NET Remoting?
Channels represent the objects that transfer the other serialized objects from one application domain to another and from one computer to another, as well as one process to another on the same box. A channel must exist before an object can be transferred.
• 12. What’s SingleCall activation mode used for?
If the server object is instantiated for responding to just one single request, the request should be made in SingleCall mode
• 15. Can you configure a .NET Remoting object via XML file?
Yes, via machine.config and application level .config file (or web.config in ASP.NET). Application-level XML settings take precedence over machine.config. 

• How should we add an assembly reference?

If a DLL project is referenced in an application, using Add Reference--> Projects, the referenced DLL has the source path as one of the following:

DLL in the release folder.

Note: DotNet does not considers whether the .dll is available in the release folder or not.

Incase release folder is not available then the .dll will refer the debug folder.

If the reference file is selected explicitly to point debug or release the selected folder is referenced.
• How should an assembly be uninstalled

Uninstalling an assembly should be done with care.

The following command removes the assembly hello from the global assembly cache(GAC) as long as no reference counts exist for the assembly.

gacutil /u hello

Note : If there is only one version of hello assembly the above command is fine and you are in safer side. Incase if there are more than one version of the assembly or different assembly with same name exists then the above command might remove more than one assembly from the assembly cache because the assembly name is not fully specified. For example, if both version 1.0.0.0 and 3.2.2.1 of hello are installed in the cache, the command gacutil /u hello removes both of the assemblies.

Then how to remove the assembly safely: Use the following example to avoid removing more than one assembly. This command removes only the hello assembly that matches the fully specified version number, culture, and public key.
gacutil /u hello, Version=1.0.0.1, Culture="de", PublicKeyToken=45e343aae32233ca

• Can I delete the source file which I have used to register in GAC

Yes, the assembly makes a copy in the GAC folder. So the source file can be deleted.

• Can I specify the space used by GAC?

Yes, Navigate to the GAC directory, C:\winnt\Assembly in explore. In the tools menu select the cache properties; in the windows displayed you can set the memory limit in MB used by the GAC.

• Why I should use Assemblies.

The .NET Framework uses assemblies as the fundamental unit for several purposes:

·         Security
·         Type Identity
·         Reference Scope
·         Versioning
·         Deployment

• What is Versioning?

Each assembly has a 128-bit version number that is presented as a set of four decimal pieces: Major.Minor.Build.Revision

For example, an assembly might have the version number 3.5.0.126.

By default, an assembly will only use types from the exact same assembly (name and version number) that it was built and tested with. That is, if you have an assembly that uses a type from version 1.0.0.2 of another assembly, it will (by default) not use the same type from version 1.0.0.4 of the other assembly. This use of both name and version to identify referenced assemblies helps avoid the "DLL Hell" problem of upgrades to one application breaking other applications.

Tip   An administrator or developer can use configuration files to relax this strict version checking. Look for information on publisher policy in the .NET Framework Developer's Guide
• Can my assembly span more that one file?

Yes, assembly can have more that one file. Each file can be developed from different language too. Using the al.exe utility all the required files are grouped and made into single file.

• Which type of reference is advantageous during development and why? Referencing the exact dll path or the project itself in a solution with more than one project, with one or more class lib project?

Referring, project itself is right and advantages, for the following reasons:

They automatically track project configuration changes. For example, when you build using a debug configuration, any project references refer to debug assemblies generated by the referenced projects, while they refer to release assemblies in a release configuration. This means that you can automatically switch from debug to release builds across projects without having to reset references.

• What are the types of caches available in .Net ?

1)     GAC, or Global Assembly Cache - all shared assemblies live here
2)     Download Cache - when you execute an assembly from a URL, this is where the downloaded assemblies end up
3)     'ZAP' Cache - this cache seems to serve as the home for pre-compiled native assembly images that are produced by NGEN

• What is called probing?

Private assemblies are deployed within the directory structure of the application in which they are used. Private assemblies can be placed directly in the application directory, or in a subdirectory thereof. The CLR finds these assemblies through a process called probing. Probing is simply a mapping of the assembly name to the name of the file that contains the manifest.

• If the same assembly is used by two app, what will be store in GAC and how it is stored.

In GAC, only one master copy of the dll is stored. But if another application is installing the same assembly (with the same version) a reference with a native image is created.

So if we have a dll, which is used by three applications, there will be one master and two images in the GAC.

You can see this when you check the GAC folder.  In COM you can't have same dlls with different versions.

• What do you call as DLL Hell in COM and how was that fixed in .Net.

Let’s consider a shared dll used by msn messenger and your own application. When you upgrade MSN Messenger, a new version of shared dll will be installed which may not be compatible with your application, which leads in failure of your application. This scenario is described as DLL Hell.

In .Net the problem is fixed using GAC - shared assembly, where you can have more than one version of the same dll. If new version of msn is installed, the new version of the dll in installed in GAC with the new version number. The important thing in GAC is that, more than one version of same dll can co-exist, so older version of dll, which is referenced by your application, will not get affected.

• What is Native image file for an assembly?

A native image is a file containing compiled processor-specific machine code. Note that the native image that Ngen.exe generates cannot be shared across Application Domains. Therefore, you cannot use Ngen.exe in application scenarios, such as ASP.NET, that require assemblies to be shared across application domains.

Pre-compiling assemblies with Ngen.exe can improve the startup time for applications, because much of the work required to execute code has been done in advance. Therefore, it is more appropriate to use Ngen.exe for client-side applications where you have determined that the CPU cycles consumed by JIT compilation cause slower performance.

• Can I limit the space used by GAC?

Yes, the size of the GAC can be modified as per the requirements. To set the size, browse through the gac folder %windir%\Assembly\ in windows explorer.

Select ToolsΰCache Options from the menu to set the maximum size of the disk space to be allotted for GAC.

• How do I see the physical file structure of cache in explorer?

It is possible to see physical file structure of GAC folder.

As such Winnt\assembly\gac cannot be browsed using windows explorer.

To view the physical file structure add a binary value named 'DisableCacheViewer' to the registry key HKLM\Software\Microsoft\Fusion and set it to a non-zero value.
• What is an Applet? Should applets have constructors?
Applet is a dynamic and interactive program that runs inside a Web page displayed by a Java capable browser. We don’t have the concept of Constructors in Applets.
• Which of the following are true about I/O filters?
Filters are supported on input, but not on output. Filters are supported by the InputStream/OutputStream class hierarchy, but not by the Reader/Writer class hierarchy. Filters read from one stream and write to another. A filter may alter data that is read from one stream and written to another.
• What is meant by Stream and what are the types of Streams and classes of the Streams?
A Stream is an abstraction that either produces or consumes information. There are two types of Streams. They are: Byte Streams : Byte Streams provide a convenient means for handling input and output of bytes. Character Streams : Character Streams provide a convenient means for handling input and output of characters. Byte Stream classes : Byte Streams are defined by using two abstract classes. They are:InputStream and OutputStream. Character Stream classes : Character Streams are defined by using two abstract classes. They are : Reader and Writer.
• What are wrapper classes?
: Wrapper classes are classes that allow primitive types to be accessed as objects.
• What is the difference between String and StringBuffer?
String objects are constants, whereas StringBuffer objects are not. String class supports constant strings, whereas StringBuffer class supports growable, modifiable strings
• 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 overridees.The overriding method may not throw any exceptions that may not be thrown by the overridden method.
• What is meant by daemon thread? In java runtime, what is it's role?
Daemon thread is a low priority thread which runs intermittently in the background doing the garbage collection operation for the java runtime system.
• What is the ‘finally’ block?
Finally block will execute whether or not an exception is thrown. If an exception is thrown, the finally block will execute even if no catch statement match the exception. Any time a method is about to return to the caller from inside try/catch block, via an uncaught exception or an explicit return statement, the finally clause is also execute.
• What is ‘Resource leak’?
Freeing up other resources that might have been allocated at the beginning of a method.
• ) What is the difference between ‘Exception’ and ‘error’ in java?
Exception and Error are the subclasses of the Throwable class. Exception class is used for exceptional conditions that user program should catch. With exception class we can subclass to create our own custom exception. Error defines exceptions that are not excepted to be caught by you program. Example is Stack Overflow.
• What is the difference between ‘throw’ and ‘throws’ ?And it’s application?
Exceptions that are thrown by java runtime systems can be handled by Try and catch blocks. With throw exception we can handle the exceptions thrown by the program itself. If a method is capable of causing an exception that it does not handle, it must specify this behavior so the callers of the method can guard against that exception
• What is difference between interface and an abstract class?
All the methods declared inside an Interface are abstract. Where as abstract class must have at least one abstract method and others may be concrete or abstract. In Interface we need not use the keyword abstract for the methods.
• How are the variables declared?
Variables can be declared anywhere in the method definition and can be initialized during their declaration.They are commonly declared before usage at the beginning of the definition. Variables with the same data type can be declared together. Local variables must be given a value before usage.
• What are the kinds of variables in Java? What are their uses?
Java has three kinds of variables namely, the instance variable, the local variable and the class variable. Local variables are used inside blocks as counters or in methods as temporary variables and are used to store information needed by a single method. Instance variables are used to define attributes or the state of a particular object and are used to store information needed by multiple methods in the objects. Class variables are global to a class and to all the instances of the class and are useful for communicating between different objects of all the same class or keeping track of global states.
• Runtime Exception
Without the cast to sub you would get a compile time error. The cast tells the compiler that you really mean to do this and the actual type of b does not get resolved until runtime. Casting down the object hierarchy as the compiler cannot be sure what has been implemented in descendent classes. Casting up is not a problem because sub classes will have the features of the base classes. This can feel counter intuitive if you are aware that with primitives casting is allowed for widening operations (ie byte to int).
• Error Mine must be declared abstract?
A class that contains an abstract method must itself be declared as abstract. It may however contain non abstract methods. Any class derived from an abstract class must either define all of the abstract methods or be declared abstract itself.

 

 
All rights reserved © 2001- 2007 marlatechnologies.