Adsnese

Ad

Thursday, September 27, 2007

.NET Remoting Interview Questions

1. What’s a Windows process?

It’s an application that’s running and had been allocated memory.

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. Why do you call it a process? What’s different between process and application in .NET, not common computer usage, terminology?

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 distributed process frameworks outside .NET do you know?

Distributed Computing Environment/Remote Procedure Calls (DEC/RPC), Microsoft Distributed Component Object Model (DCOM), Common Object Request Broker Architecture (CORBA), and Java Remote Method Invocation (RMI).
5. 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.
6. When would you use .NET Remoting and when Web services?
Use remoting for more efficient exchange of information when you control both ends of the application. Use Web services for open-protocol-based information exchange when you are just a client or a server with the other end belonging to someone else.
7. What’s a proxy of the server object in .NET Remoting?
It’s a fake copy of the server object that resides on the client side and behaves as if it was the server. It handles the communication between real server object and the client object. This process is also known as marshaling.
8. 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.
9. 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.
10. What security measures exist for .NET Remoting in System.Runtime.Remoting?
None. Security should be taken care of at the application level. Cryptography and other security techniques can be applied at application or server level.
11. What is a formatter?
A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.
12. Choosing between HTTP and TCP for protocols and Binary and SOAP for formatters, what are the trade-offs?
Binary over TCP is the most effiecient, SOAP over HTTP is the most interoperable.
13. 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.
14. What’s Singleton activation mode?
A single object is instantiated regardless of the number of clients accessing it. Lifetime of this object is determined by lifetime lease.
15. How do you define the lease of the object?
By implementing ILease interface when writing the class code.
16. 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.
17. How can you automatically generate interface for the remotable object in .NET with Microsoft tools?
Use the Soapsuds tool.

.NET Interview Questions

1. Write a simple Windows Forms MessageBox statement.
System.Windows.Forms.MessageBox.Show ("Hello, Windows Forms");

2. Can you write a class without specifying namespace? Which namespace does it belong to by default??

Yes, you can, then the class belongs to global namespace which has no name. For commercial products, naturally, you wouldn’t want global namespace.

3. You are designing a GUI application with a window and several widgets on it. The user then resizes the app window and sees a lot of grey space, while the widgets stay in place. What’s the problem?

One should use anchoring for correct resizing. Otherwise the default property of a widget on a form is top-left, so it stays at the same location when resized.

4. 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.

5. So 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.

6. Can you automate this process?

In Visual Studio yes, use Dynamic Properties for automatic .config creation, storage and retrieval.

7. 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.

8. What’s the safest way to deploy a Windows Forms app?

Web deployment: the user always downloads the latest version of the code; the program runs within security sandbox, properly written app will not require additional security privileges.
9. Why is it not a good idea to insert code into InitializeComponent method when working with Visual Studio?

The designer will likely throw it away; most of the code inside InitializeComponent is auto-generated.

10. 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.

11. What’s the difference between Move and LocationChanged? Resize and SizeChanged?

Both methods do the same, Move and Resize are the names adopted from VB to ease migration to C#.

12. 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.

13. How do you create a separator in the Menu Designer?

A hyphen ‘-’ would do it. Also, an ampersand ‘&\’ would underline the next letter.

14. How’s anchoring different from docking?

Anchoring treats the component as having the absolute size and adjusts its location relative to the parent form. Docking treats the component location as absolute and disregards the component size. So if a status bar must always be at the bottom no matter what, use docking. If a button should be on the top right, but change its position with the form being resized, use anchoring.

ASP.NET Interview Questions - 3

1. What base class do all Web Forms inherit from?

The Page class.


2. Name two properties common in every validation control?

ControlToValidate property and Text property.


3. What tags do you need to add within the asp:datagrid tags to bind columns manually?

Set AutoGenerateColumns Property to false on the datagrid tag.

4. What tag do you use to add a hyperlink column to the DataGrid?


5. What is the transport protocol you use to call a Web service?

SOAP is the preferred protocol.

6. True or False: A Web service can only be written in .NET?
False


7. What does WSDL stand for?

(Web Services Description Language)


9. Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?

DataTextField property


10. Which control would you use if you needed to make sure the values in two different controls matched?

CompareValidator Control


11. True or False: To test a Web service you must create a windows application or Web application to consume this service?

False, the webservice comes with a test page and it provides HTTP-GET method to test.


12. How many classes can a single .NET DLL contain?
It can contain many classes.

ASP.NET Interview Questions - 2

1. What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?

Server.Transfer is used to post a form to another page. Response.Redirect is used to redirect the user to another page or site.

2. Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?

· A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
· A DataSet is designed to work without any continuing connection to the original data source.
· Data in a DataSet is bulk-loaded, rather than being loaded on demand.
· There's no concept of cursor types in a DataSet.
· DataSets have no current record pointer You can use For Each loops to move through the data.
· You can store many edits in a DataSet, and write them to the original data source in a single operation.
· Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.


3. Can you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines?

This is where you can set the specific variables for the Application and Session objects.


4. If I’m developing an application that must accommodate multiple security levels though secure login and my ASP.NET web application is spanned across three web-servers (using round-robin load balancing) what would be the best approach to maintain login-in state for the users?

Maintain the login state security through a database.


5. Can you explain what inheritance is and an example of when you might use it?

When you want to inherit (use the functionality of) another class. Base Class Employee. A Manager class could be derived from the Employee base class.


6. Whats an assembly?

Assemblies are the building blocks of the .NET framework.


7. Explain what a diffgram is, and a good use for one?

The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. For reading database data to an XML file to be sent to a Web Service.


8. Whats MSIL, and why should my developers need an appreciation of it if at all?

MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL.


9. Which method do you invoke on the DataAdapter control to load your generated dataset with data?

The .Fill() method


10. Can you edit data in the Repeater control?

No, it just reads the information from its data source


11. Which template must you provide, in order to display data in a Repeater control?

ItemTemplate


12. How can you provide an alternating color scheme in a Repeater control?

Use the AlternatingItemTemplate


13. What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?

You must set the DataSource property and call the DataBind method.

ASP.NET Interview Questions - 1

1. Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.

inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.


2. What’s the difference between Response.Write() andResponse.Output.Write()?


The latter one allows you to write formattedoutput.


3. What methods are fired during the page load?


Init() - when the pageis instantiated, Load() - when the page is loaded into server memory,PreRender() - the brief moment before the page is displayed to the user asHTML, Unload() - when page finishes loading.


4. Where does the Web page belong in the .NET Framework class hierarchy?

System.Web.UI.Page

5. Where do you store the information about the user’s locale?

System.Web.UI.Page.Culture

6. What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?

CodeBehind is relevant to Visual Studio.NET only.


7. What’s a bubbled event?

When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.


8. Suppose you want a certain ASP.NET function executed on MouseOver overa certain button. Where do you add an event handler?

It’s the Attributesproperty, the Add function inside that property. So btnSubmit.Attributes.Add("onMouseOver","someClientCode();")


9. What data type does the RangeValidator control support?

Integer,String and Date.


10. Explain the differences between Server-side and Client-side code?

Server-side code runs on the server. Client-side code runs in the clients’ browser.

11. What type of code (server or client) is found in a Code-Behind class?

Server-side code.

12. Should validation (did the user enter a real date) occur server-side or client-side? Why?

Client-side. This reduces an additional request to the server to validate the users input.


13. What does the "EnableViewState" property do? Why would I want it on or off?

It enables the viewstate on the page. It allows the page to save the users input on a form.

C# Interview Questions -6

Question Can you change the value of a variable while debugging a C# application?
Answer: Yes, if you are debugging via Visual Studio.NET, just go to Immediate window.

Question Explain the three services model (three-tier application). Presentation (UI), business (logic and underlying code) and data (from storage or other sources).

Question What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?

Answer: SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix, but it’s a .NET layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a deprecated layer provided for backward compatibility to ODBC engines.
Question What’s the role of the DataReader class in ADO.NET connections?
Answer: It returns a read-only dataset from the data source when the command is executed.

Question What is the wildcard character in SQL?
Answer: Let’s say you want to query database with LIKE for all employees whose name starts with La. The wildcard character is %, the proper query with LIKE would involve ‘La%’.

Question Explain ACID rule of thumb for transactions. Transaction must be Atomic (it is one unit of work and does not dependent on previous and following transactions), Consistent (data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t), Isolated (no transaction sees the intermediate results of the current transaction), Durable (the values persist if the data had been committed even if the system crashes right after).

Question What connections does Microsoft SQL Server support?

Answer: Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and passwords).

Question Which one is trusted and which one is untrusted?
Answer: Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction.

Question Why would you use untrusted verificaion?
Answer: Web Services might use it, as well as non-Windows applications.

Question What does the parameter Initial Catalog define inside Connection String? The database name to connect to.

Question What’s the data provider name to connect to Access database?
Answer: Microsoft.Access.

Question What does Dispose method do with the connection object?
Answer: Deletes it from the memory.

Question What is a pre-requisite for connection pooling?
Answer: Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings.


C# Interview Questions -5

Question What’s the difference between and XML documentation tag?
Answer: Single line code example and multiple-line code example.

Question Is XML case-sensitive?
Answer: Yes, so and are different elements.

Question What debugging tools come with the .NET SDK?
Answer: CorDBG – command-line debugger, and DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg, you must compile the original C# file using the /debug switch.

Question What does the This window show in the debugger?
Answer: It points to the object that’s pointed to by this reference. Object’s instance data is shown.

Question What does assert() do?
Answer: In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true.

Question What’s the difference between the Debug class and Trace class?
Answer: Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds.

Question Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
Answer: The tracing dumps can be quite verbose and for some applications that are constantly running you run the risk of overloading the machine and the hard drive there. Five levels range from None to Verbose, allowing to fine-tune the tracing activities.

Question Where is the output of TextWriterTraceListener redirected? To the Console or a text file depending on the parameter passed to the constructor.

Question How do you debug an ASP.NET Web application?

Answer: Attach the aspnet_wp.exe process to the DbgClr debugger.

Question What are three test cases you should go through in unit testing?
Answer: Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling), exception test cases (exceptions are thrown and caught properly).


C# Interview Questions -4

Question What’s the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception?
Answer: A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.

Question Can multiple catch blocks be executed?
Answer: No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block.

Question Why is it a bad idea to throw your own exceptions?
Answer: Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project.

Question What’s a delegate?
Answer: A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.

Question What’s a multicast delegate?
Answer: It’s a delegate that points to and eventually fires off several methods.

Question How’s the DLL Hell problem solved in .NET?
Answer: Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.

Question What are the ways to deploy an assembly?
Answer: An MSI installer, a CAB archive, and XCOPY command.



Question What’s a satellite assembly?
Answer: When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.

Question What namespaces are necessary to create a localized application?
Answer: System.Globalization, System.Resources.

Question What’s the difference between // comments, /* */ comments and /// comments?
Answer: Single-line, multi-line and XML documentation comments.

Question How do you generate documentation from the C# file commented properly with a command-line compiler?
Answer: Compile it with a /doc switch.


C# Interview Questions -3

Question What’s the difference between an interface and abstract class?
Answer: In the interface all methods must be abstract; in the abstract class some methods can be concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract classes.

Question How can you overload a method?
Answer: Different parameter data types, different number of parameters, different order of parameters.

Question If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor?
Answer: Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.

Question What’s the difference between System.String and System.StringBuilder classes?
Answer: System.String is immutable; System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.

Question What’s the advantage of using System.Text.StringBuilder over System.String?
Answer: StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it’s being operated on, a new instance is created.

Question Can you store multiple data types in System.Array?
Answer: No.

Question What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
Answer: The first one performs a deep copy of the array, the second one is shallow.

Question How can you sort the elements of the array in descending order?
Answer: By calling Sort() and then Reverse() methods.

Question What’s the .NET datatype that allows the retrieval of data by a unique key?
Answer: HashTable.

Question What’s class SortedList underneath?
Answer: A sorted HashTable.

Question Will finally block get executed if the exception had not occurred?
Answer: Yes.


C# Interview Questions -2

Question Can you override private virtual methods?
Answer: No, moreover, you cannot access private methods in inherited classes, have to be protected in the base class to allow any sort of access.

Question Can you prevent your class from being inherited and becoming a base class for some other classes?
Answer: Yes, that’s what keyword sealed in the class definition is for. The developer trying to derive from your class will get a message: cannot inherit from Sealed class WhateverBaseClassName. It’s the same concept as final class in Java.

Question Can you allow class to be inherited, but prevent the method from being over-ridden?
Answer: Yes, just leave the class public and make the method sealed.

Question What’s an abstract class?
Answer: A class that cannot be instantiated. A concept in C++ known as pure virtual method. A class that must be inherited and have the methods over-ridden. Essentially, it’s a blueprint for a class without any implementation.

Question When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)?
Answer: When at least one of the methods in the class is abstract. When the class itself is inherited from an abstract class, but not all base abstract methods have been over-ridden.

Question What’s an interface class?
Answer: It’s an abstract class with public abstract methods all of which must be implemented in the inherited classes.

Question Why can’t you specify the accessibility modifier for methods inside the interface?
Answer: They all must be public. Therefore, to prevent you from getting the false impression that you have any freedom of choice, you are not allowed to specify any accessibility, it’s public by default.

Question Can you inherit multiple interfaces?
Answer: Yes, why not.



Question And if they have conflicting method names?
Answer: It’s up to you to implement the method inside your own class, so implementation is left entirely up to you. This might cause a problem on a higher-level scale if similarly named methods from different interfaces expect different data, but as far as compiler cares you’re okay.


C# Interview Questions -1

Question: What’s the implicit name of the parameter that gets passed into the class’ set method?
Answer: Value, and its datatype depends on whatever variable we’re changing.

Question: How do you inherit from a class in C#?
Answer Place a colon and then the name of the base class. Notice that it’s double colon in C++.

Question: Does C# support multiple inheritance?
Answer No, use interfaces instead.

Question When you inherit a protected class-level variable, who is it available to?
Answer: Classes in the same namespace.

Question Are private class-level variables inherited?
Answer: Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are.

Question Describe the accessibility modifier protected internal.
Answer: It’s available to derived classes and classes within the same Assembly (and naturally from the base class it’s declared in).

Question C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?
Answer: Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there’s no implementation in it.

Question What’s the top .NET class that everything is derived from?
Answer: System.Object.

Question How’s method overriding different from overloading?
Answer: When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class.

Question What does the keyword virtual mean in the method definition?
Answer: The method can be over-ridden.

Question Can you declare the override method static while the original method is non-static?
Answer: No, you can’t, the signature of the virtual method must remain the same, only the keyword virtual is changed to keyword override.

Wednesday, September 26, 2007

Java Interview Questions-11

Question: What is Serialization and deserialization?
Answer:
Serialization is the process of writing the state of an object to a byte stream. Deserialization is the process of restoring these objects.

Question: what is tunnelling?
Answer:
Tunnelling is a route to somewhere. For example, RMI tunnelling is a way to make RMI application get through firewall. In CS world, tunnelling means a way to transfer data.

Question: Does the code in finally block get executed if there is an exception and a return statement in a catch block?
Answer:
If an exception occurs and there is a return statement in catch block, the finally block is still executed. The finally block will not be executed when the System.exit(1) statement is executed earlier or the system shut down earlier or the memory is used up earlier before the thread goes to finally block.

Question: How you restrict a user to cut and paste from the html page?
Answer:
Using javaScript to lock keyboard keys. It is one of solutions.

Question: Is Java a super set of JavaScript?
Answer:
No. They are completely different. Some syntax may be similar.

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

Question: How the object oriented approach helps us keep complexity of software development under control?
Answer:

We can discuss such issue from the following aspects:

o Objects allow procedures to be encapsulated with their data to reduce potential interference.

o Inheritance allows well-tested procedures to be reused and enables changes to make once and have effect in all relevant places.

o The well-defined separations of interface and implementation allows constraints to be imposed on inheriting classes while still allowing the flexibility of overriding and overloading.

Question: What is polymorphism?
Answer:
Polymorphism allows methods to be written that needn't be concerned about the specifics of the objects they will be applied to. That is, the method can be specified at a higher level of abstraction and can be counted on to work even on objects of yet unconceived classes.

Question: What is design by contract?
Answer:
The design by contract specifies the obligations of a method to any other methods that may use its services and also theirs to it. For example, the preconditions specify what the method required to be true when the method is called. Hence making sure that preconditions are. Similarly, postconditions specify what must be true when the method is finished, thus the called method has the responsibility of satisfying the post conditions.

In Java, the exception handling facilities support the use of design by contract, especially in the case of checked exceptions. The assert keyword can be used to make such contracts.

Question: What are use cases?
Answer:
A use case describes a situation that a program might encounter and what behavior the program should exhibit in that circumstance. It is part of the analysis of a program. The collection of use cases should, ideally, anticipate all the standard circumstances and many of the extraordinary circumstances possible so that the program will be robust.

Question: What is the difference between interface and abstract class?
Answer:

o interface contains methods that must be abstract; abstract class may contain concrete methods.

o interface contains variables that must be static and final; abstract class may contain non-final and final variables.

o members in an interface are public by default, abstract class may contain non-public members.

o interface is used to "implements"; whereas abstract class is used to "extends".

o interface can be used to achieve multiple inheritance; abstract class can be used as a single inheritance.

o interface can "extends" another interface, abstract class can "extends" another class and "implements" multiple interfaces.

o interface is absolutely abstract; abstract class can be invoked if a main() exists.

o interface is more flexible than abstract class because one class can only "extends" one super class, but "implements" multiple interfaces.

o If given a choice, use interface instead of abstract class.

Java Interview Questions-10

Question: What class allows you to read objects directly from a stream?
Answer:
The ObjectInputStream class supports the reading of objects from input streams.

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

Question: How is it possible for two String objects with identical values not to be equal under the == operator?
Answer:
The == operator compares two objects to determine if they are the same object in memory. It is possible for two String objects to have the same value, but located indifferent areas of memory.

Question: What an I/O filter?
Answer:
An I/O filter is an object that reads from one stream and writes to another, usually altering the data in some way as it is passed from one stream to another.

Question: What is the Set interface?
Answer:
The Set interface provides methods for accessing the elements of a finite mathematical set. Sets do not allow duplicate elements.

Question: What is the List interface?
Answer:
The List interface provides support for ordered collections of objects.

Question: What is the purpose of the enableEvents() method?
Answer:
The enableEvents() method is used to enable an event for a particular object. Normally, an event is enabled when a listener is added to an object for a particular event. The enableEvents() method is used by objects that handle events by overriding their event-dispatch methods.

Question: What is the difference between the File and RandomAccessFile classes?
Answer:
The File class encapsulates the files and directories of the local file system. The RandomAccessFile class provides the methods needed to directly access data contained in any part of a file.

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

Question: What is the ResourceBundle class?
Answer:
The ResourceBundle class is used to store locale-specific resources that can be loaded by a program to tailor the program's appearance to the particular locale in which it is being run.

Question: What is the difference between a Scrollbar and a ScrollPane?
Answer:
A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. A ScrollPane handles its own events and performs its own scrolling.

Question: What is a Java package and how is it used?
Answer:
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.

Question: What are the Object and Class classes used for?
Answer:
The Object class is the highest-level class in the Java class hierarchy. The Class class is used to represent the classes and interfaces that are loaded by a Java program.

Java Interview Questions-9

Question: Which class should you use to obtain design information about an object?
Answer:
The Class is used to obtain information about an object's design.

Question: How can a GUI component handle its own events?
Answer:
A component can handle its own events by implementing the required event-listener interface and adding itself as its own event listener.

Question: How are the elements of a GridBagLayout organized?
Answer:
The elements of a GridBagLayout are organized according to a grid. However, the elements are of different sizes and may occupy more than one row or column of the grid. In addition, the rows and columns may have different sizes.

Question: What advantage do Java's layout managers provide over traditional windowing systems?
Answer:
Java uses layout managers to lay out components in a consistent manner across all windowing platforms. Since Java's layout managers aren't tied to absolute sizing and positioning, they are able to accommodate platform-specific differences among windowing systems.

Question: What are the problems faced by Java programmers who don't use layout managers?
Answer:
Without layout managers, Java programmers are faced with determining how their GUI will be displayed across multiple windowing systems and finding a common sizing and positioning that will work within the constraints imposed by each windowing system.

Question: What is the difference between static and non-static variables?
Answer:
A static variable is associated with the class as a whole rather than with specific instances of a class. Non-static variables take on unique values with each object instance.

Question: What is the difference between the paint() and repaint() methods?
Answer:
The paint() method supports painting via a Graphics object. The repaint() method is used to cause paint() to be invoked by the AWT painting thread.

Question: What is the purpose of the File class?
Answer:
The File class is used to create objects that provide access to the files and directories of a local file system.

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

Question: What restrictions are placed on method overriding?
Answer:
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.

Question: What is casting?
Answer:
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.

Question: Name Container classes.
Answer:
Window, Frame, Dialog, FileDialog, Panel, Applet, or

Java Interview Questions-8

Question: Which package has light weight components?
Answer:
javax.Swing package. All components in Swing, except JApplet, JDialog, JFrame and JWindow are lightweight components.

Question: What are peerless components?
Answer:
The peerless components are called light weight components.

Question: What is the difference between the Font and FontMetrics classes?
Answer:
The FontMetrics class is used to define implementation-specific properties, such as ascent and descent, of a Font object.

Question: What happens when a thread cannot acquire a lock on an object?
Answer:
If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object's lock, it enters the waiting state until the lock becomes available.

Question: What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
Answer:
The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented.

Question: What classes of exceptions may be caught by a catch clause?
Answer:
A catch clause can catch any exception that may be assigned to the Throwable type. This includes the Error and Exception types.

Question: What is the difference between throw and throws keywords?
Answer:
The throw keyword denotes a statement that causes an exception to be initiated. It takes the Exception object to be thrown as argument. The exception will be caught by an immediately encompassing try-catch construction or propagated further up the calling hierarchy. The throws keyword is a modifier of a method that designates that exceptions may come out of the method, either by virtue of the method throwing the exception itself or because it fails to catch such exceptions that a method it calls may throw.

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

Question: What is the Map interface?
Answer:
The Map interface replaces the JDK 1.1 Dictionary class and is used associate keys with values.

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

Question: Name primitive Java types.
Answer:
The primitive types are byte, char, short, int, long, float, double, and Boolean.

Java Interview Questions-7

Question: What is the purpose of the finally clause of a try-catch-finally statement?
Answer:
The finally clause is used to provide the capability to execute code no matter whether or not an exception is thrown or caught.

Question: What is the Locale class?
Answer:
The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region.

Question: What must a class do to implement an interface?
Answer:
It must provide all of the methods in the interface and identify the interface in its implements clause.

Question: What is an abstract method?
Answer:
An abstract method is a method whose implementation is deferred to a subclass. Or, a method that has no implementation (an interface of a method).

Question: What is a static method?
Answer:
A static method is a method that belongs to the class rather than any object of the class and doesn't apply to an object or even require that any objects of the class have been instantiated.

Question: What is a protected method?
Answer:
A protected method is a method that can be accessed by any method in its package and inherited by any subclass of its class.

Question: What is the difference between a static and a non-static inner class?
Answer:
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.

Question: What is an object's lock and which object's have locks?
Answer:
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.

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

Question: What is the difference between a Window and a Frame?
Answer:
The Frame class extends Window to define a main application window that can have a menu bar.

Question: What do heavy weight components mean?
Answer:
Heavy weight components like Abstract Window Toolkit (AWT), depend on the local windowing toolkit. For example, java.awt.Button is a heavy weight component, when it is running on the Java platform for Unix platform, it maps to a real Motif button. In this relationship, the Motif button is called the peer to the java.awt.Button. If you create two Buttons, two peers and hence two Motif Buttons are also created. The Java platform communicates with the Motif Buttons using the Java Native Interface. For each and every component added to the application, there is an additional overhead tied to the local windowing system, which is why these components are called heavy weight.

Java Interview Questions-6

Question: How can you write a loop indefinitely?
Answer:
for(;;)--for loop; while(true)--always true, etc.

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

Question: What is the purpose of finalization?
Answer:
The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.

Question: Which class is the superclass for every class.
Answer:
Object.

Question: What is the difference between the Boolean & operator and the && operator?
Answer:
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.
Operator & has no chance to skip both sides evaluation and && operator does. If asked why, give details as above.

Question: What is the GregorianCalendar class?
Answer:
The GregorianCalendar provides support for traditional Western calendars.

Question: What is the SimpleTimeZone class?
Answer:
The SimpleTimeZone class provides support for a Gregorian calendar.

Question: Which Container method is used to cause a container to be laid out and redisplayed?
Answer:
validate()

Question: What is the Properties class?
Answer:
The properties class is a subclass of Hashtable that can be read from or written to a stream. It also provides the capability to specify a set of default values to be used.

Question: What is the purpose of the Runtime class?
Answer:
The purpose of the Runtime class is to provide access to the Java runtime system.

Question: What is the purpose of the System class?
Answer:
The purpose of the System class is to provide access to system resources.

Java Interview Questions-5

Question: What is the Vector class?
Answer:
The Vector class provides the capability to implement a growable array of objects 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.

Question: If a method is declared as protected, where may the method be accessed?
Answer:
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.

Question: What is an Iterator interface?
Answer:
The Iterator interface is used to step through the elements of a Collection.

Question: How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?
Answer:
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.

Question: What is the difference between yielding and sleeping?
Answer:
When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state.

Question: Is sizeof a keyword?
Answer:
The sizeof operator is not a keyword.

Question: What are wrapped classes?
Answer:
Wrapped classes are classes that allow primitive types to be accessed as objects.

Question: Does garbage collection guarantee that a program will not run out of memory?
Answer:
No, it doesn't. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection

Question: What is the difference between preemptive scheduling and time slicing?
Answer:
Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors.

Question: Name Component subclasses that support painting.
Answer:
The Canvas, Frame, Panel, and Applet classes support painting.

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

Java Interview Questions-4

Question: How to create multithread in a program?
Answer:
You have two ways to do so. First, making your class "extends" Thread class. Second, making your class "implements" Run able interface. Put jobs in a run() method and call start() method to start the thread.

Question: Can Java object be locked down for exclusive use by a given thread?
Answer:
Yes. You can lock an object by putting it in a "synchronized" block. The locked object is inaccessible to any thread other than the one that explicitly claimed it

Question: Can each Java object keep track of all the threads that want to exclusively access to it?
Answer:
Yes

Question: What state does a thread enter when it terminates its processing?
Answer:
When a thread terminates its processing, it enters the dead state.

Question: What invokes a thread's run() method?
Answer:
After a thread is started, via its start() method of the Thread class, the JVM invokes the thread's run() method when the thread is initially executed.

Question: What is the purpose of the wait(), notify(), and notifyAll() methods?
Answer:
The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to communicate each other.

Question: What are the high-level thread states?
Answer:
The high-level thread states are ready, running, waiting, and dead.

Question: What is the Collections API?
Answer:
The Collections API is a set of classes and interfaces that support operations on collections of objects.

Question: What is the List interface?
Answer:
The List interface provides support for ordered collections of objects.

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

Java Interview Questions-3

Question: What are synchronized methods and synchronized statements?
Answer:
Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class. Synchronized statements are similar to synchronized methods. A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement.

Question: What are three ways in which a thread can enter the waiting state?
Answer:
A thread can enter the waiting state by invoking its sleep() method, by blocking on I/O, by unsuccessfully attempting to acquire an object's lock, or by invoking an object's wait() method. It can also enter the waiting state by invoking its (deprecated) suspend() method.

Question: Can a lock be acquired on a class?
Answer:
Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.

Question: What's new with the stop(), suspend() and resume() methods in JDK 1.2?
Answer:
The stop(), suspend() and resume() methods have been deprecated in JDK 1.2.

Question: What is the preferred size of a component?
Answer:
The preferred size of a component is the minimum component size that will allow the component to display normally.

Question: What method is used to specify a container's layout?
Answer:
The setLayout() method is used to specify a container's layout.

Question: Which containers use a FlowLayout as their default layout?
Answer:
The Panel and Applet classes use the FlowLayout as their default layout.

Question: What is thread?
Answer:
A thread is an independent path of execution in a system.

Question: What is multithreading?
Answer:
Multithreading means various threads that run in a system.

Question: How does multithreading take place on a computer with a single CPU?
Answer:
The operating system's task scheduler allocates execution time to multiple tasks. By quickly switching between executing tasks, it creates the impression that tasks execute sequentially.

Java Interview Questions-2

Question: . How many methods in the Externalizable interface?
Answer:
There are two methods in the Externalizable interface. You have to implement these two methods in order to make your class externalizable. These two methods are readExternal() and writeExternal().

Question: What is the difference between Serializalble and Externalizable interface?
Answer:
When you use Serializable interface, your class is serialized automatically by default. But you can override writeObject() and readObject() two methods to control more complex object serailization process. When you use Externalizable interface, you have a complete control over your class's serialization process.

Question: What is a transient variable?
Answer:
A transient variable is a variable that may not be serialized. If you don't want some field to be serialized, you can mark that field transient or static.

Question: Which containers use a border layout as their default layout?
Answer:
The Window, Frame and Dialog classes use a border layout as their default layout.

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

Question: What is synchronization and why is it important?
Answer:
With respect to multi threading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often causes dirty data and leads to significant errors.

Question: What are synchronized methods and synchronized statements?
Answer:
Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class. Synchronized statements are similar to synchronized methods. A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement.

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

Question: What is synchronization and why is it important?
Answer:
With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often causes dirty data and leads to significant errors.

Java Interview Questions-1

Question: What is the main difference between Java platform and other platforms?
Answer:
The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other hardware-based platforms. The Java platform has two components:

1. The Java Virtual Machine (Java VM)

2. The Java Application Programming Interface (Java API)

Question: What is the Java Virtual Machine?
Answer:
The Java Virtual Machine is a software that can be ported onto various hardware-based platforms.

Question: What is the Java API?
Answer:
The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets.

Question: What is the package?
Answer:
The package is a Java namespace or part of Java libraries. The Java API is grouped into libraries of related classes and interfaces; these libraries are known as packages.

Question: What is native code?
Answer:
The native code is code that after you compile it, the compiled code runs on a specific hardware platform.

Question: Is Java code slower than native code?
Answer:
Not really. As a platform-independent environment, the Java platform can be a bit slower than native code. However, smart compilers, well-tuned interpreters, and just-in-time bytecode compilers can bring performance close to that of native code without threatening portability.

Question: What is the serialization?
Answer:
The serialization is a kind of mechanism that makes a class or a bean persistence by having its properties or fields and state information saved and restored to and from storage.

Question: How to make a class or a bean serializable?
Answer:
By implementing either the java.io.Serializable interface, or the java.io.Externalizable interface. As long as one class in a class's inheritance hierarchy implements Serializable or Externalizable, that class is serializable.

Java Interview Questions

Question: Why Java does not support multiple inheritence ?
Answer:
Java DOES support multiple inheritance via interface implementation.

Question:What is the difference between final, finally and finalize?
Answer:
o final - declare constant
o finally - handles exception
o finalize - helps in garbage collection

Question: Where and how can you use a private constructor.
Answer:
Private constructor can be used if you do not want any other class to instantiate the object , the instantiation is done from a static public method, this method is used when dealing with the factory method pattern when the designer wants only one controller (fatory method ) to create the object.

Question: In System.out.println(),what is System, out and println, pls explain?
Answer:
System is a predefined final class,out is a PrintStream object and println is a built-in overloaded method in the out object.

Question: What is meant by "Abstract Interface"?
Answer:
First, an interface is abstract. That means you cannot have any implementation in an interface. All the methods declared in an interface are abstract methods or signatures of the methods.

Question: Can you make an instance of an abstract class? For example - java.util.Calender is an abstract class with a method getInstance() which returns an instance of the Calender class.
Answer:
No! You cannot make an instance of an abstract class. An abstract class has to be sub-classed. If you have an abstract class and you want to use a method which has been implemented, you may need to subclass that abstract class, instantiate your subclass and then call that method.

Question: What is the difference between Swing and AWT components?
Answer:
AWT components are heavy-weight, whereas Swing components are lightweight. Heavy weight components depend on the local windowing toolkit. For example, java.awt. Button is a heavy weight component, when it is running on the Java platform for Unix platform, it maps to a real Motif button.

Question: Why Java does not support pointers?
Answer: Because pointers are unsafe. Java uses reference types to hide pointers and programmers feel easier to deal with reference types without pointers. This is why Java and C# shine.


C Interview Questions

1. What will print out?
main()
{
char *p1=“name”;
char *p2;
p2=(char*)malloc(20);
memset (p2, 0, 20);
while(*p2++ = *p1++);
printf(“%s\n”,p2);
}
Answer:empty string.

2. What will be printed as the result of the operation below:
main()
{
int x=20,y=35;
x=y++ + x++;
y= ++y + ++x;
printf(“%d%d\n”,x,y);
}
Answer : 5794

3. What will be printed as the result of the operation below:
main()
{
int x=5;
printf(“%d,%d,%d\n”,x,x< <2,x>>2);
}
Answer: 5,20,1

4. What will be printed as the result of the operation below:
#define swap(a,b) a=a+b;b=a-b;a=a-b;
void main()
{
int x=5, y=10;
swap (x,y);
printf(“%d %d\n”,x,y);
swap2(x,y);
printf(“%d %d\n”,x,y);
}
int swap2(int a, int b)
{
int temp;
temp=a;
b=a;
a=temp;
return 0;
}
Answer: 10, 5
10, 5
5. What will be printed as the result of the operation below:
main()
{
char *ptr = ” Cisco Systems”;
*ptr++; printf(“%s\n”,ptr);
ptr++;
printf(“%s\n”,ptr);
}
Answer:Cisco Systems
isco systems

6. What will be printed as the result of the operation below:
main()
{
char s1[]=“Cisco”;
char s2[]= “systems”;
printf(“%s”,s1);
}
Answer: Cisco

7. What will be printed as the result of the operation below:
main()
{
char *p1;
char *p2;
p1=(char *)malloc(25);
p2=(char *)malloc(25);
strcpy(p1,”Cisco”);
strcpy(p2,“systems”);
strcat(p1,p2);
printf(“%s”,p1);
}
Answer: Ciscosystems

8. The following variable is available in file1.c, who can access it?
static int average;
Answer: all the functions in the file1.c can access the variable.

9. WHat will be the result of the following code?
#define TRUE 0 // some code
while(TRUE)
{
// some code
}
Answer: This will not go into the loop as TRUE is defined as 0.

10. What will be printed as the result of the operation below:
int x;
int modifyvalue()
{
return(x+=10);
}
int changevalue(int x)
{
return(x+=1);
}
void main()
{
int x=10;
x++;
changevalue(x);
x++;
modifyvalue();
printf("First output:%d\n",x);
x++;
changevalue(x);
printf("Second output:%d\n",x);
modifyvalue();
printf("Third output:%d\n",x);
}
Answer: 12 , 13 , 13
11. What will be printed as the result of the operation below:
main()
{
int x=10, y=15;
x = x++;
y = ++y;
printf(“%d %d\n”,x,y);
}
Answer: 11, 16
12. What will be printed as the result of the operation below:
main()
{
int a=0;
if(a==0)
printf(“Cisco Systems\n”);
printf(“Cisco Systems\n”);
}
Answer: Two lines with “Cisco Systems” will be printed.

1. What does static variable mean?
2. What is a pointer?
3. What is a structure?
4. What are the differences between structures and arrays?
5. In header files whether functions are declared or defined?
6. What are the differences between malloc() and calloc()?
7. What are macros? What are the advantages and disadvantages?
8. Difference between pass by reference and pass by value?
9. What is static identifier?
10. Where are the auto variables stored?
11. Where does global, static, local, register variables, free memory and C Program instructions get stored?
12. Difference between arrays and linked list?
13. What are enumerations?
14. Describe about storage allocation and scope of global, extern, static, local and register variables?
15. What are register variables? What are the advantage of using register variables?
16. What is the use of typedef?
17. Can we specify variable field width in a scanf() format string? If possible how?
18. Out of fgets() and gets() which function is safe to use and why?
19. Difference between strdup and strcpy?
20. What is recursion?
21. Differentiate between a for loop and a while loop? What are it uses?
22. What are the different storage classes in C?
23. Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?
24. What is difference between Structure and Unions?
25. What the advantages of using Unions?
26. What are the advantages of using pointers in a program?
27. What is the difference between Strings and Arrays?
28. In a header file whether functions are declared or defined?
29. What is a far pointer? where we use it?
30. How will you declare an array of three function pointers where each function receives two ints and returns a float?
31. What is a NULL Pointer? Whether it is same as an uninitialized pointer?
32. What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?
33. What does the error ‘Null Pointer Assignment’ mean and what causes this error?
34. What is near, far and huge pointers? How many bytes are occupied by them?
35. How would you obtain segment and offset addresses from a far address of a memory location?
36. Are the expressions arr and *arr same for an array of integers?
37. Does mentioning the array name gives the base address in all the contexts?
38. Explain one method to process an entire string as one unit?
39. What is the similarity between a Structure, Union and enumeration?
40. Can a Structure contain a Pointer to itself?
41. How can we check whether the contents of two structure variables are same or not?
42. How are Structure passing and returning implemented by the complier?
43. How can we read/write Structures from/to data files?
44. What is the difference between an enumeration and a set of pre-processor # defines?
45. What do the ‘c’ and ‘v’ in argc and argv stand for?
46. Are the variables argc and argv are local to main?
47. What is the maximum combined length of command line arguments including the space between adjacent arguments?
48. If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?
49. Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?
50. What are bit fields? What is the use of bit fields in a Structure declaration?
51. To which numbering system can the binary number 1101100100111100 be easily converted to?
52. Which bit wise operator is suitable for checking whether a particular bit is on or off?
53. Which bit wise operator is suitable for turning off a particular bit in a number?
54. Which bit wise operator is suitable for putting on a particular bit in a number?
55. Which bit wise operator is suitable for checking whether a particular bit is on or off?
56. Which one is equivalent to multiplying by 2?
57. Left shifting a number by 1
58. Left shifting an unsigned int or char by 1?
59. Write a program to compare two strings without using the strcmp() function.
60. Write a program to concatenate two strings.

ACCENTURE PAPER ON 12th AUGUST AT LUCKNOW

1. WRITTEN+ESSAY WRITING
2. GD
3. HR INTERVIEW
4. TECHNICAL INTERVIEW

1. WRITTEN-(1 hour)
Easy to clear, It has 3 sections

a) ENGLISH-
Total 20 questions.10 Fill in the blanks of prepositions, synonyms & antonyms,
2 passages related to computers.

b) APTITUDE-
Refer R.S.Agarwaal.
Topics on which questions were asked are:
· Blood Relations
· Directions
· Time & Distance
· Questions like if 100 people like to watch cricket, 200 like to watch football & so on…..

c) VERBAL & NON-VERBAL-
Refer R.S.Agarwaal
Topics on which questions were asked are:
· Mathematical Operations
· Data Sufficiency
· Logic
· Puzzle Test

d) ESSAY WRITING-
10 mins, 100-150 words “IMPACT OF INFORMATION TECHNOLOGY IN INDIA”.
450 people cleared the written test out of 3000 people.
ON 25th August we had our GD & Interview. We reached our centre at 10:00AM.
Firstly we had a 40-45mins PPT (Pre-Placement Talk). Listen carefully as it will help you in HR interview also.

2) GD-
Firstly the coordinator asked us to suggest some topics but he gave us the following topic: “IMPACT OF INFORMATION TECHNOLOGY IN INDIA AFTER 10YEARS. "
In GD you must put your points confidently & speak something. If you put your points confidently they will select you. In our group 6 people were selected from 12. In GD 150 students were selected from 450.

3) HR-
· Tell me about yourself?
· Why your 12th % was low?
· Do you know C?
· What is linked list?
· What is stack pointer? (I didn’t know the answer & I simply said” I don’t know.” Remember if you don’t know the answer tell them. It will be beneficial.)
· What is a register?
· What is the difference between LAN & WAN? (As I have asked her to ask from Computer Networks.)
· What is the difference between Routers & Switches?
· What is OSI?
· Name all the 7 layers of OSI.

Then the interviewer asked me if I was having any questions. I asked her that I want to pursue my MBA, how will Accenture help me out?

The HR interview carried out for about 10-15 mins. After my interview the interviewer told me to wait outside. I was told that I had cleared my HR & be ready for my Technical interview. After 10mins I was called for my technical interview.

4) TECHNICAL-
It was carried out for about 15-20mins.
· Tell me about yourself?
· Which sport do u like?
· Why Accenture?
· Why should I hire you?
· Why your 12th% was low?
· Some concepts of addressing.
· Which subjects have you studied?
· What was your GD topic & questions related with GD topic?
· Why were u selected in GD?

Placement Paper of ACCENTURE On 18th August

1.Written test + Essay
2.GD
3.HR interview
4.Tech interview

1.Written Test + Essay
About 900+ students appeared for the test and about 290 cleared the test. The written test was very easy. For the pattern just go thru all the Accenture papers available in this site. it is very very useful had to answer 55 Q in 55 minutes .there is no negative marking. After that we were told to write an essay for 5 minutes, The topic was MY COLLEGE LIFE. Prepare some common topics for essay because there is mark for the essay.

2.GD
On 25th we had the GD. first we were given the ppt and it takes more than an hour. Listen their ppt carefully because when we go to HR they will ask about Accenture. For the GD they divided the students into groups of 15 each. My topic for the GD was Coeducation. The other topics given were India for the past 60 years, Does the introduction of IT industry is a hindrance to research, End justifies means and Mean justifies end. These 4 topics were repeated for the whole group of students. Try to start the GD. if u start it is half done. After starting just make 2 more entries. That’s more than enough. if u are not able to start then say some points. When you speak be confident and speak loudly. if u didn’t get chance to speak more just give a nice conclusion if u are told to conclude. From a group of 15 they selected 6 or 7. After the GD they will give you a form to fill. They eliminated half of the students in the GD.

3. HR
We had our Hr on 26th.my HR was a cool and friendly person .I entered the room with permission
me:-Good morning sir
HR:-Hey....good morning ..... What u had for breakfast
me:-said

HR:-Tell me about your self
me:-Said
HR:-What u know about Accenture
me:-Say their revenue ,no of employees ,ceo ,rank among the companies and all u know about Accenture
HR:-Top 3 IT companies in India
me:-TCS,INFOSYS,WIPRO and SATHYAM
HR:-What is team work?
me:-All the members working together with co-ordination and co-operation to achieve a single goal.
HR:-Do you have any offers?
me:-No sir
HR:-Why?
me:-I was not prepared
HR:-Do you have any gaps in your studies?
me:-No sir
HR:-Are u sure?
me:-Yes sir
HR:-Ok....r u ready to relocate?
me:-Yes
HR:-R u ready to work in nightshifts?
me:-Yes
HR:-What would u do if your parents didn’t allow u to work outside?
me:-I m free to decide my career
HR:-What is your father?
me:-Said
HR:-What is your mother?
me:-Said
HR:-Any siblings
me:-Said(if your sis/bro is also a soft pro they will ask y u don’t want to work with their company so prepared with that)
HR:-your GPA?
me:- Said
HR:-Have you done any seminars
me:-I have done one seminar when I was in first semester(always say u have did one ,even u haven’t. just prepare a topic)
HR:-What was it?
me:-As I did in first semester...I don’t remember it sir
HR:-But u should
me:-Then I said what I remember
HR:-Any project or mini project
me:-Said(just prepare your pro/mini pro well)
HR:-What you do in your leisure time
me:-Said(they will ask about it in detail)
HR:- Haveyou ever organized any event in college?
me:-Said(say u have organized even if u haven’t ..just prepare an event for that)
HR:-Thank you ..you can go
me:-Thank you sir....have a nice day
HR:-U too

4.Tech interview
Me:-Good morning sir
Tech:-Good morning. take your seat
Me:-Thank you sir
Tech:-Tell me about your academics
Me:-Told
Tech:-Any project or mini project
Me:-Told in detail
Tech:-Y u have less marks in Engineering as compared to 12th and 10th
Me:-Prepare a solid reason for this if u have less marks in Engineering
Tech:-What is your branch?
Me:-cse
Tech:-Is this your first interview?
Me:-I wrote the tests of TCS and INFOSYS. But I was not able to clear the tests
Tech:-What is Boyce Codd normal form
Me:-Told the definition
Tech:-I didn’t understand your formulas...show with a table
Me:-Did(he wil argue with u but make him convinced by saying that u r right)
Tech:-What is 4th normal form
Me:-Told
Tech:-Does the above table satisfies 4th NF?
Me:-Told
Tech:-What is super key?
Me:-Told
Tech:-Which is the primary key in the above table
Me:-Told
Tech:-How will u avoid data redundancy in the above table
Me:-Told by showing values in the table...told my point until he is convinced
Tech:-Now convinced and smiled...any Q's?
Me:-No sir....I had a lot of Q's in my mind...but all got cleared in the ppt itself
Tech:-Ok thank you
Me:-Thank you sir ....have a nice day
Tech:-Ok

Many people r eliminated in the tech and there is a 10% elimination in the HR. those who r not placed in your first attempts just don’t give hope.....just do your part and God will do the rest....just believe in your self and work hard......what these Accenture people looking in u is your confidence.....if u r average or above in your communication skill then b confident..........

My Ad

.