Showing posts with label Interview Questions. Show all posts
Showing posts with label Interview Questions. Show all posts

Sunday, 12 February 2012

Interview Materials

Sunday, 29 January 2012

Core Java Interview Questions


1) Explain about Core Java ?
 Java is increasingly used for middleware applications to communicate between Server and clients. Java has features such as multithreading, portability and networking capabilities. Changes in the java library made java as a favorite programming language for developers it added functionality to their scripts.

2) State some advantages of Java?
 Platform independence is the key feature of Java during runtime. Syntax of java is similar to the popular object oriented languages such as C and C++. Java program can eliminate most of the bugs present in the program. Manual memory allocation and de allocation feature present in Java is automated.

3) State the main difference between C++ and Java?
 The main difference between C++ and Java lies in multiple inheritances. Java Meta class model has a better solution than C++. Persistent objects can be implemented by features such as object serialization and reflection mechanism. GUI can be implemented easily.

4) Explain about the security aspect of Java?
 Java has some bugs in its applets. Java team stated that they have zero tolerance over security features and subsequent editions of Java are improving Bug free environment. Some of the features are overriding the runtime stack, disallowing the corruption of memory outside its own process, reading or writing on local files where it is actually forbidden to do these processes, etc.

5) Explain about the interpreter in Java?
 Machines should have Java interpreter for the Java byte code to get executed. Linking is a very easy process and this feature helps while developing applications. Java compiler which is available with software development kit is a bit slower in execution of scripts.

6) Explain about the performance aspects of Core Java?
 Performance of interpreted byte codes is enough but it can be improved much more than that. Byte codes are translated into machine language within no time, this speed of execution can be achieved during application compiling time. JIT compilers are also present which compile the byte codes into native code.

7) Explain about the dynamic behavior of core java?
 This language was designed to adapt the changing environment and behavior. New methods and instance variables can be added to the client side without any major changes happening at the client end. This function is very important for GUI builders, pluggable components, debuggers and object database.

8.)Explain about Java SDK?
 Java SDK is not so comfortable with people used to command line interpreter. IDEs include compilers, editors, debugging facilities, drag and drop techniques, etc. This compiler strives to generate hundreds of lines in code UI. This platform may become a universal platform.

9) What are the three best choices for development environment?
 The three best choices for development environment include.
 1) Java SDK and text editor can be a perfect choice.
 2) Java SDK and a text editor which is built within the SDK.
 3) Using IDE such as free Forte community edition.

10) Explain about Class in Java?
 In Java every thing exists within a class. It defines the behavior of the class and its characteristics. Java applications and applets are built in the class. Rules present for class name are generous and some of the basic rules are names should start with a letter after that letter they can have any combination of letters and digits. It can contain names to any length.

 11) Explain about data types?
 Variables declared should have a declared type. Out of the eight data types four data types are integer, two are floating type integers, one is character type out of which one is Boolean and the other Unicode. Core Java is known to be a strong typed language.

12) Explain about assignment statement?
 After declaring a variable, it should be initialized explicitly. Uninitialized variable can never be used. To a declared variable you must assign a variable name on the left, equal sign and a java expression should have a appropriate value to the right.

13) Give the difference between the println method and sqrt method?
 Println method operates on the object system.out and has the value which should be printed namely y. sqrt method is a static method. It does not operate on any object. It has the number stored in x for which the square toot should be found out.

14) Explain about strings in Java?
 Strings represent nothing but a string of characters. Java does not have any built in string type. It contains predefined class which can be called enough as a String. Instance of a string is called as a string. Much similar to many object oriented languages a + sign is used.

15) Explain the reason behind ending a program with a System.exit (0)?
 The reason behind ending a program with System.exit (0) involves technicalities. When main method exits the new thread automatically does not end. The appearance of this thread is because of dialog box functionality. System.exit ends all the methods.

16) Explain about inheritance hierarchies?
 An inheritance hierarchy has a collection of all classes which fall under the main class. Inheritance chain defines the path from where all the sub classes originated and their relation ship. Controller normally handles user input. Inheritance hierarchy is very important in software modeling.

17) Explain about the select method with an example?
 Select part is useful in selecting text or part of the text. Arguments specified for the select command are the same as applicable to substring. First index is usually represents the start of the index. End of line makers are counted as one character. 

ICICI Placement Papers



1)If on an item a company gives 25% discount, they earn 25% profit. If they now give 10% discount then what is the profit percentage.
 (a) 40% (b) 55% (c)  35% (d) 30%
 (Ans. D) 

2)A certain number of men can finish a piece of work in 10 days. If however there were 10 men less it will take 10 days more for the work to be finished. How many men were there originally?
 (a) 110 men (b) 130 men (c) 100 men (d) none of these
 (Ans. A)

3)In simple interest what sum amounts of Rs.1120/- in 4 years and Rs.1200/- in 5 years ?
 (a) Rs. 500 (b) Rs. 600 (c) Rs. 800 (d) Rs. 900
 (Ans. C)

4)If a sum of money compound annually amounts of thrice itself in 3 years. In how many years will it become 9 times itself.
 (a) 6 (b) 8 (c) 10 (d) 12
 (Ans A)

5)Two trains move in the same direction at 50 kmph and 32 kmph respectively. A man in the slower train observes the 15 seconds elapse before the faster train completely passes by him. What is the length of faster train ?
 (a) 100m (b) 75m (c) 120m (d) 50m
 (Ans B)

Ajax Interview Questions and Answers


What kinds of applications is Ajax best suited for?
 We don’t know yet. Because this is a relatively new approach, our understanding of where Ajax can best be applied is still in its infancy. Sometimes the traditional web application model is the most appropriate solution to a problem.

Does this mean Adaptive Path is anti-Flash?
 Not at all. Macromedia is an Adaptive Path client, and we’ve long been supporters of Flash technology. As Ajax matures, we expect that sometimes Ajax will be the better solution to a particular problem, and sometimes Flash will be the better solution. We’re also interested in exploring ways the technologies can be mixed (as in the case of Flickr, which uses both).

Where can I find examples of AJAX?
 While components of AJAX have been around for some time (for instance, 1999 for XMLHttpRequest), it really didn’t become that popular until Google took…

What is the XMLHttpRequest object?
 It offers a non-blocking way for JavaScript to communicate back to the web server to update only part of the web page.

Does Ajax have significant accessibility or browser compatibility limitations? Do Ajax applications break the back button? Is Ajax compatible with REST? Are there security considerations with Ajax development? Can Ajax applications be made to work for users who have JavaScript turned off?
 The answer to all of these questions is “maybe”. Many developers are already working on ways to address these concerns. We think there’s more work to be done to determine all the limitations of Ajax, and we expect the Ajax development community to uncover more issues like these along the way.

How do I access data from other domains to create a mashup with Java?
 From your JavaScript clients you can access data in other domains if the return data is provide in JSON format. In essence you can create a JavaScript client that runs operates using data from a different server. This technique is know as JSON with Padding or JSONP.

There are questions as to whether this method is secure as you are retrieving data from outside your domain and allowing it to be excuted in the context of your domain. Not all data from third parties is accessible as JSON and in some cases you may want an extra level of protection. With Java you can provide a proxy to third party services using a web component such as a servlet.

This proxy can manage the communication with a third party service and provide the data to your clients in a format of your choosing. You can also cache data at your proxy and reduce trips to service. For more on using a Java proxy to create mashups see The XmlHttpProxy Client for Java.

Does Java have support for Comet style server-side push?
 Current AJAX applications use polling to communicate changes data between the server and client. Some applications, such as chat applications, stock tickers, or score boards require more immediate notifications of updates to the client. Comet is an event based low latency server side push for AJAX applications. Comet communication keeps one of the two connections available to the browser open to continously communicate events from the server to the client. A Java based solution for Comet is being developed for Glassfish on top of the Grizzly HTTP connector. See Enabling Grizzly by Jean-Francois Arcand for more details.

How do I create a thread to do AJAX polling?
 JavaScript does not have threads. JavaScript functions are called when an event happens in a page such as the page is loaded, a mouse click, or a form element gains focus. You can create a timer using the setTimeout which takes a function name and time in milliseconds as arguments. You can then loop by calling the same function as can be seen in the JavaScript example below.

function checkForMessage() {
 // start AJAX interaction with processCallback as the callback function
 }

// callback for the request
 function processCallback() {

// do post processing
 setTimeout(“checkForMessage()”, 10000);
 }

Notice that the checkForMessage will continue to loop indefinitely. You may want to vary the increment the interval based on activity in the page or your use cases. You may also choose to have logic that would break out of the loop based on some AJAX response processing condition.

Is the XMLHttpRequest object part of a W3C standard?
 No. Or not yet. It is part of the DOM Level 3 Load and Save Specification proposal.

source : interviewquestionsadda