Showing posts with label interview questions. Show all posts
Showing posts with label interview questions. Show all posts

October 09, 2013

c / c++ Interview Questions



Question- What is a register variable?
Answer- Register variables are stored in the CPU registers. Its default value is a garbage value. Scope of a register variable is local to the block in which it is defined. Lifetime is till control remains within the block in which the register variable is defined. Variable stored in a CPU register can always be accessed faster than the one that is stored in memory. Therefore, if a variable is used at many places in a program, it is better to declare its storage class as register
 

For Example:
register int x=5;
Variables for



Question-     What’s the difference between COM and DCOM? 
Answer- the question does not require strict answer. Any DCOM object is yet a COM object (DCOM extends COM) and any COM object may participate in DCOM transactions. DCOM introduced several improvements/optimizations for distributed environment, such as MULTI_QI (multiple QueryInterface()), security contexts etc. DCOM demonstrated importance of surrogate process (you cannot run in-proc server on a remote machine. You need a surrogate process to do that.) DCOM introduced a load balancing.

Question- Where is an auto variables stored?
Answer- Main memory and CPU registers are the two memory locations where auto variables are stored. Auto variables are defined under automatic storage class. They are stored in main memory. Memory is allocated to an automatic variable when the block which contains it is called and it is de-allocated at the completion of its block execution.
Auto variables:
Storage           :             main memory.
Default value  :             garbage value.
Scope             :             local to the block in which the variable is defined.
Lifetime          :             till the control remains within the block in which the variable is defined.



Question- What is a node class? 
Answer- A node class is a class that,
o    relies on the base class for services and implementation,
o    provides a wider interface to the users than its base class,
o    relies primarily on virtual functions in its public interface
o    depends on all its direct and indirect base class
o    can be understood only in the context of the base class
o    can be used as base for further derivation
o    can be used to create objects.
A node class is a class that has added new services or functionality beyond the services inherited from its base class. 
 
Question- What is an orthogonal base class? 
Answer- If two base classes have no overlapping methods or data they are said to be independent of, or orthogonal to each other. Orthogonal in the sense means that two classes operate in different dimensions and do not interfere with each other in any way. The same derived class may inherit such classes with no difficulty.

Core Java Interview Questions And Answers



Question- Can there be an abstract class with no abstract methods
in it?
Answer- Yes


Question-
Can an Interface be final?
Answer- No

Question- Can an Interface have an inner class?
Answer- Yes.
public interface abc {
static int i=0;
void dd();
class a1 {
a1() {
int j;
System.out.println("in interfia");
};
public static void main(String a1[]) {
System.out.println("in interfia"); } } }


Question- Can we define private and protected modifiers for
variables in interfaces? (Core Java)
Answer- No

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

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

April 30, 2013

ASP.NET Interview Questions and Answers

What is difference between a Label control and a Literal control?
Ans- The Label control's final html code has an HTML tag; whereas, the Literal control's final html code contains only text, which is not surrounded by any HTML tag.



What is the difference between ASP session and ASP.NET session?
Ans- ASP does not support cookie-less sessions;
whereas, ASP.NET does. In addition, the ASP.NET session can span across multiple servers.


What is the use of the <sessionState> tag in the web.config file?
Ans- The <sessionState> tag is used to configure the session state features. To change the default timeout, which is 20 minutes, you have to add the following code snippet to the web.config file of an application: <sessionState timeout="40"/>


Which class is inherited when an ASP.NET server control is added to a Web form?
Ans- The System.Web.UI.WebControls class is inherited when an ASP.NET server control is added to a Web form.


How many types of Cookies are available in ASP.NET?
Ans- There are two types of Cookies available in ASP.NET:

  • Session Cookie - Resides on the client machine for a single session until the user does not log out.
  • Persistent Cookie - Resides on a user's machine for a period specified for its expiry, such as 10 days, one month, and never.
The user can set this period manually.

What are Web server controls in ASP.NET?
Ans- The ASP.NET Web server controls are objects on the ASP.NET pages that run when the Web page is requested. Many Web server controls, such as button and text box, are similar to the HTML controls. In addition to the HTML controls, there are many controls, which include complex behavior, such as the controls used to connect to data sources and display data.
What type of the CatalogPart control enables users to restore the Web Parts that have been removed earlier by the user?
Ans- The PageCatalogPart control.

ASP.NET Interview Questions and Answers

What does the "EnableViewState" property do? Why do we want it On or Off?
Ans- The EnableViewState property enables the ViewState property on the page. It is set to On to allow the page to save the users input between postback requests of a Web page; that is, between the Request and corresponding Response objects. When this property is set to Off, the page does not store the users input during postback.


What is the function of the CustomValidator
control?
Ans- It provides the customize validation code to perform both client-side and server-side validation.


Which data type does the RangeValidator control support?
Ans- The data types supported by the RangeValidator control are Integer, Double, String, Currency, and Date.


Why a SiteMapPath control is referred to as breadcrumb or eyebrow navigation control?
Ans- The SiteMapPath control displays a hierarchical path to the root Web page of the Web site. Therefore, it is known as the breadcrumb or eyebrow navigation control.


Which namespaces are necessary to create a localized application?
Ans- The System.Globalization and System.Resources namespaces are essential to develop a localized application.


What is the difference between HTML and Web server controls?
Ans- HTML controls are client-side controls; therefore, all the validations for HTML controls are performed at the client side. On the other hand, Web server controls are server-side controls; therefore, all the validations for Web server controls are performed at the server side.


What is the difference between absolute expiration and sliding-time expiration?
Ans- The absolute expiration expires a cached item after the provided expiration time. The sliding time does not expire the cached items because it increments the specified time.

ASP.NET Interview Questions and Answers

In which database is the information, such as membership, role management, profile, and Web parts personalization, stored?
Ans- The aspnetdb database stores all information.


What do you understand by aggregate dependency?
Ans- Aggregate dependency allows multiple dependencies to be aggregated for content that depends on more than one resource. In such type of dependency, you need to depend on the sum of all the defined dependencies to remove a data item
from the cache.


To which class a Web form belongs to in the .NET Framework class hierarchy?
Ans- A Web form belongs to the System.Web.UI.Page class.

What is the difference between adding items into cache through the Add() method and through the Insert() method?
Ans- Both methods work in a similar way except that the Cache.Add() function returns an object that represents the item you added in the cache. The Cache.Insert() function can replace an existing item in the cache, which is not possible using the Cache.Add() method.


What is a round trip?
Ans- The trip of a Web page from the client to the server and then back to the client is known as a round trip.


Where should the data validations be performed-at the client side or at the server side and why?
Ans- Data validations should be done primarily at the client side and the server-side validation should be avoided because it makes server task overloaded. If the client-side validation is not available, you can use server-side validation. When a user sends a request to the server, the validation controls are invoked to check the user input one by one.


What type of code, client-side or server-side, is found in a code-behind file of a Web page?
Ans- A code-behind file contains the server-side code, which means that the code contained in a code-behind file is executed at the server.

ASP.NET Interview Questions and Answers

What setting must be added in the configuration file to deny a particular user from accessing the secured resources?
Ans- To deny a particular user form accessing the secured resources, the web.config file must contain the following code:

<authorization >
<deny users="username" />
</authorization>


 What is the difference between page-level caching
and fragment caching?
Ans- In the page-level caching, an entire Web page is cached; whereas, in the fragment caching, a part of the Web page, such as a user control added to the Web page, is cached.


 How can you assign page specific attributes in an ASP.NET application?
Ans- The @Page directive is responsible for this.

 What is a Cookie? Where is it used in ASP.NET?
Ans- Cookie is a lightweight executable program, which the server posts to client machines. Cookies store the identity of a user at the first visit of the Web site and validate them later on the next visits for their authenticity. The values of a cookie can be transferred between the user's request and the server's response.

What does the .WebPart file do?
Ans- The .WebPart file explains the settings of a Web Parts control that can be included to a specified zone on a Web page.
 
What are the event handlers that can be included in the Global.asax file?
Ans- The Global.asax file contains some of the following important event handlers:

  • Application_Error
  • Application_Start
  • Application_End
  • Session_Start
  • Session_End 

How can you enable impersonation in the web.config file?
Ans- To enable impersonation in the web.confing file, you need to include the <identity> element in the web.config file and set the impersonate attribute to true as shown in the following code snippet:
<identity impersonate = "true" />

ASP.NET Interview Questions and Answers

How can you send an email message from an ASP.NET Web page?
Ans- You can use the System.Net.Mail.MailMessage and the System.Net.Mail.SmtpMail classes to send an email in your Web pages. In order to send an email through your mail server, you need to create an object of the SmtpClient class and set the server name, port, and credentials.


What is the difference between the Response.Write() and Response.Output.Write() methods?
Ans- The Response.Write() method allows you to write the normal output; whereas, the Response.Output.Write() method allows you to write the formatted output.


Differentiate between client-side and server-side validations in Web pages.
Ans- Client-side validations take place at thehttp://www.blogger.com/blogger.g?blogID=1100445556152057720#editor/target=post;postID=7962939421597285574 client end with the help of JavaScript and VBScript before the Web page is sent to the server. On the other hand, server-side validations take place at the server end.


What is the default timeout for a Cookie?
Ans- The default time duration for a Cookie is 30 minutes.

What are the events that happen when a client requests an ASP.NET page from IIS server?
Ans- The following events happen when a client requests an ASP.NET page from the IIS server:

  1. User requests for an application resource.
  2. The integrated request-processing pipeline receives the first user request.
  3. Response objects are created for each user request.
  4. An object of the HttpApplication class is created and allocated to the Request object.
  5. The HttpApplication class processes the user request. 

Explain file-based dependency and key-based dependency.
Ans- In file-based dependency, you have to depend on a file that is saved in a disk. In key-based dependency, you have to depend on another cached item.


How can you implement the postback property of an ASP.NET control?
Ans- You need to set the AutoPostBack property to True to implement the PostBack property of controls.

ASP.NET Interview Questions and Answers

Why do you use the App_Code folder in ASP.NET?
Ans- The App_Code folder is automatically present in the project. It stores the files, such as classes, typed data set, text files, and reports. If this folder is not available in the application, you can add this folder. One of the important features of the App_Code folder is that only one dll is created for the complete folder, irrespective of how many files it contains.


What is an ASP.NET Web Form?
Ans- ASP.NET Web forms are designed to use controls and features that are almost as powerful as the ones used with Windows forms, and so they are called as Web forms. The Web form uses a server-side object model that allows you to create functional controls, which are executed on the server and are rendered as HTML on the client. The attribute, runat="server", associated with a server control indicates that the Web form must be processed on the server.


Define a multilingual Web site.
Ans- A multilingual Web site serves content in a number of languages. It contains multiple copies for its content and other resources, such as date and time, in different languages.


What is the difference between a default skin and a named skin?
Ans- The default skin is applied to all the Web server controls in a Web form, which are of similar type, and it does not provide a Skin ID attribute. The named skin provides a Skin ID attribute and users have to set the Skin ID property to apply it.


What is actually returned from server to the browser when a browser requests an .aspx file and the file is displayed?
Ans- When a browser requests an .aspx file then the server returns a response, which is rendered into a HTML string


How can you register a custom server control to a Web page?
Ans- You can register a custom server control to a Web page using the @Register directive.


What is ViewState?
Ans- The ViewState is a feature used by ASP.NET Web page to store the value of a page and its controls just before posting the page. Once the page is posted, the first task by the page processing is to restore the ViewState to get the values of the controls.

ASP .NET Interview Questions and Answers

What is the basic difference between ASP and ASP.NET?
Ans- The basic difference between ASP and ASP.NET is that ASP is interpreted; whereas, ASP.NET is compiled. This implies that since ASP uses VBScript; therefore, when an ASP page is executed, it is interpreted. On the other hand, ASP.NET uses .NET languages, such as C# and VB.NET, which are compiled to Microsoft Intermediate Language (MSIL).

How can we identify that the Page is Post Back?
Ans- Page object has an "IsPostBack" property, which can be checked to know that is the page posted back.


What is the lifespan for items stored in ViewState?
Ans- The items stored in ViewState live until the lifetime of the current page expires including the postbacks to the same page.


How information about the user's locale can be accessed?
Ans- The information regarding a user's locale can be accessed by using the System.Web.UI.Page.Culture property.


What is the difference between SQL notification and SQL invalidation?
Ans- The SQL cache notification generates notifications when the data of a database changes, on which your cache item depends. The SQL cache invalidation makes a cached item invalid when the data stored in a SQL server database changes.


What are the advantages of the code-behind feature?
Ans- The code-behind feature of ASP.NET offers a number of advantages:

  • Makes code easy to understand and debug by separating application logic from HTML tags
  • Provides the isolation of effort between graphic designers and software engineers
  • Removes the problems of browser incompatibility by providing code files to exist on the Web server and supporting Web pages to be compiled on demand.

ASP.NET interview questions and answers

What are the differences between custom Web control and user control?
Ans- Custom Web control is a control that inherits from web server control available in ASP.Net.
A Custom Web Control could be compiled into separate .dll file. This custom Web control can be shared across all application by installing this dll in to Global Assembly Catch.
User Control is a file (.ascx file) that contains a set of ASP.Net controls and code grouped together to provide common functionality across the application. User control can be used on different web pages of
the application.


Explain ASP.Net Catching? What are different catching mechanisms available in ASP.Net?
Ans- ASP.Net catching one of the important performance factor for large web applications.
ASP.Net Catching stores frequently accessed data in to catch object.
There are two different types catching in ASP.Net
1.Application Catching
2.Page Output Catching


What is ASP.Net? What are the advantages ASP.Net Technologies?
Ans- ASP.Net is a server side Technology to develop a web based applications.ASP.Net will make use of .Net framework features.
Advantages of ASP.Net
  • ASP.NET makes development simpler and easier to maintain with an event-driven, server-side programming model
  • ASP.NET offers built-in security features through windows authentication or other authentication methods.
  • Content and program logic are separated which reduces the inconveniences of program maintenance.
  • Built-in caching features.

What are the different validation controls available in ASP.Net?
Ans- RequiredFieldValidator: Verifies whether a control contains data
CompareValidator: Verifies whether an entered item matches an entry in another control
RangeValidator: Verifies whether an entered item is between two values
RegularExpressionValidator: Verifies whether an entered item matches a specified format
CustomValidator: Verifies the validity of an entered item using a client-side script or a server-side code, or both
ValidationSummary: Displays validation errors in a central location or display a general validation error description


Where do the ASP.NET validation controls validate data, on the Client or on the Web Server?
Ans- ASP.NET validation controls validate data on the client as well as web server. If we need to validate data on client side itself, we have to set a property to controls to execute at the client side.

Core Java Interview Questions And Answers

Question: Why do u use Session Tracking in HttpServlet?
Answer: In HttpServlet you can use Session Tracking to track the user state. Session is required if you are developing shopping cart application or in any e-commerce application.


Question: What are the advantage of Cookies over URL rewriting?
Answer: Sessions tracking using Cookies are more secure and fast. Session tracking
using Cookies can also be used with other mechanism of Session Tracking like url rewriting.
Cookies are stored at client side so some clients may disable cookies so we may not sure that the cookies may work or not.

In url  rewriting requites large data transfer from and to the server. So, it leads to network traffic and access may be become slow.


Question: What is session hijacking?
Answer: If you application is not very secure then it is possible to get the access of system after acquiring or generating the authentication information. Session hijacking refers to the act of taking control of a user session after successfully obtaining or generating an authentication session ID. It involves an attacker using captured, brute forced or reverse-engineered session IDs to get a control of a legitimate user's Web application session while that session is still in progress.


Question: What is Session Migration?
Answer: Session Migration is a mechanism of moving the session from one server to another in case of server failure. Session Migration can be implemented by:
a) Persisting the session into database
b) Storing the session in-memory on multiple servers.


Question: How to track a user session in Servlets?
Answer: The interface HttpSession can be used to track the session in the Servlet. Following code can be used to create session object in the Servlet: HttpSession session = req.getSession(true);


Question: How you can destroy the session in Servlet?
Answer: You can call invalidate () method on the session object to destroy the session. e.g. session.invalidate();
  • Blogger news

    This Blog Contains All Topics Related To Internet, Website Help, Interview Questions, News, Results From Various Resources, Visit Daily For More Interesting And Famous Topics.
  • Random Post

  • About

    We Provide All Information Which you Needed. We Maintain This Blog Very Carefully, If You Find Any Mistake or Any Suggestions Then Please Let Us Know, You Can Contact Us By Comments, On FB Page Or On Google+ Page. ~ Thank You