08 August, 2014

Tavant Technologies Java Interview Questions - Experienced

Tavant Technologies
Round 1:F2F
1) Tell abt ur technical skills
2) How to work with ajax applications?
4) Asked about page factory design concepts.
5) What are the collections u used in ur project?
6) Framework explanation
7) How to find no of rows or columns in a table?
8) Diff b/w interface and abstract class?
9) Various oops concepts used in the project?
10) Roles and responsibilities.
11) SQL queriesa) how to find duplicate records in a table b) Display the name of the emp who is getting         10th maximum salary
12) Logical questions:
i) A 2l bottle and a 4l bottle, By this u have to give me 3l of water? Is it possible? If yes tell me how
ii) 8 balls, having same color and weight, out of that 1 is defective, a physical balance is given, using this how to find the defective one.

Round 2
1. What is run-time polymorphism? Explain with program? Where is it achieved?
2. SQL queriesemp table fieldsename,eid,age
a) Find the name of the emp who has 3rd max age
b) Having clause and where clause
3. Logical questions
a) Cake in round shape, u have to cut the cake by 3 times only, and u have to divide into 8 equal pieces
b) Using 5 zeros, how to make it as 120
c) He gave me a paper, asked me to tore the paper once, to make 3 equal pieces


Round 3- HR+ Managerial round

1. Tell abt ur self
2. Why u r looking for the job?
3. What are the difficulties u faced in ur previous job?
4. He is asking the same questions in different ways for 15 min
5. Framework
6. Difference b/w abstract class and interface.
7. Scenario-an abstract class implements an interface, can the abstract class implement the methods of interface?
8. From that he asked that do u perform auto it scripts in parallel execution?
9. Difference B/w primary key and unique key
10. Can unique key column hold null values? If yes how many null values?
11. Use of super keyword, order of execution
12. Collections u used in the project
13. When array will be used ? and when array list will be used?




02 July, 2014

Birla Soft Interview Question & Answers for Java 2- 4 year experience.

The below questions asked by Birla Soft for Java/J2EE. I tried to give the best answer , hope it will help you out to crack the interview.


Q. Tell me about your self?
 Ans:  Give your brief introduction.

Q. Is Java Pass by Reference or Pass by Value?
Ans : Its always pass by value .

Q. What is the difference between an Interface and an Abstract class?
Ans : Both are looks similar. But, the basic difference is abstract class can contain abstract and non abstract methods, where interface only contains abstract method (without method body). You can declare fields that are not static and final, and define public, protected, and private concrete methods in abstract class. But, in Interface all members are public, static and final , all methods are public.

Q. What is the purpose of garbage collection in Java, and when is it used?
Ans : Garbage collection is a special feature in java language. It helps developer to save time and extra mental tension for handling object allocation in memory. It automatically clean the unused object from memory which helps to allocate space at runtime. When there is no reference to an object found, it will clean that object from memory . You can run the garbage collection explicitly by using System.gc() .

Q. What is Marker interface? How is it used in Java?
Ans : Marker interface is an interface which help us to notify few information to JVM/Compiler. The marker interface does not have any body, it’s a empty interface. Ex. Cloneable, Serialization, etc.            

Q. Can you give few examples of final classes defined in Java API?
Ans: String, Integer ,Float ,etc. Basically all wrapper classed are final.

Q. What is the importance of init() method in Servlet?
Ans:  init() method is one of the life cycle method of servlet. This method runs once in total life. After servlet instance created and before it handles request the init() method will work. Its basically used for initializing values at the time of application startup.

Q. How to improve Servlet Performance ?
Ans: You need to do few tuning for this achievement. Few points below :-
1.     Use init() method for all expensive operation during initialization (may be static data or cached data ).
2.     Always avoid auto loading of servlet.
3.     Avoid SingleThreadModel.
4.     Use and control HttpSession properly.

Q. How can a servlet refresh automatically if some new data has entered the database?
Ans :  Basically it depends on the scenario , how you can handle. You need  handle this in dao layer, when doing insert operation you can call an utility method which will load the context ServletContextListener. Because, servlets are basically used for handling request and give the response.

Q. How does JSP handle run-time exceptions?
Ans: You can use isErrorPage=”true” in page attribute.

Q. What is an EJB Context?
Ans: The EJBContext interface provides an instance with access to the container-provided runtime context of an enterprise bean instance.





18 June, 2014

Whats New in Java 8 ?

Java Platform, Standard Edition 8 is a major feature release in brief.
  • Java Programming Language
    • Lambda Expressions, a new language feature, has been introduced in this release. They enable you to treat functionality as a method argument, or code as data. Lambda expressions let you express instances of single-method interfaces (referred to as functional interfaces) more compactly.
    • Method references provide easy-to-read lambda expressions for methods that already have a name.
    • Default methods enable new functionality to be added to the interfaces of libraries and ensure binary compatibility with code written for older versions of those interfaces.
    • Repeating Annotations provide the ability to apply the same annotation type more than once to the same declaration or type use.
    • Type Annotations provide the ability to apply an annotation anywhere a type is used, not just on a declaration. Used with a pluggable type system, this feature enables improved type checking of your code.
    • Improved type inference.
    • Method parameter reflection.
  • Collections
    • Classes in the new java.util.stream package provide a Stream API to support functional-style operations on streams of elements. The Stream API is integrated into the Collections API, which enables bulk operations on collections, such as sequential or parallel map-reduce transformations.
    • Performance Improvement for HashMaps with Key Collisions.
  • Compact Profiles contain predefined subsets of the Java SE platform and enable applications that do not require the entire Platform to be deployed and run on small devices.
  • Security
    • Client-side TLS 1.2 enabled by default
    • New variant of AccessController.doPrivileged that enables code to assert a subset of its privileges, without preventing the full traversal of the stack to check for other permissions
    • Stronger algorithms for password-based encryption
    • SSL/TLS Server Name Indication (SNI) Extension support in JSSE Server
    • Support for AEAD algorithms: The SunJCE provider is enhanced to support AES/GCM/NoPadding cipher implementation as well as GCM algorithm parameters. And the SunJSSE provider is enhanced to support AEAD mode based cipher suites. See Oracle Providers Documentation, JEP 115.
    • KeyStore enhancements, including the new Domain KeyStore type java.security.DomainLoadStoreParameter, and the new command option -importpassword for the keytool utility
    • SHA-224 Message Digests
    • Enhanced Support for NSA Suite B Cryptography
    • Better Support for High Entropy Random Number Generation
    • New java.security.cert.PKIXRevocationChecker class for configuring revocation checking of X.509 certificates
    • 64-bit PKCS11 for Windows
    • New rcache Types in Kerberos 5 Replay Caching
    • Support for Kerberos 5 Protocol Transition and Constrained Delegation
    • Kerberos 5 weak encryption types disabled by default
    • Unbound SASL for the GSS-API/Kerberos 5 mechanism
    • SASL service for multiple host names
    • JNI bridge to native JGSS on Mac OS X
    • Support for stronger strength ephemeral DH keys in the SunJSSE provider
    • Support for server-side cipher suites preference customization in JSSE
  • JavaFX
    • The new SwingNode class enables developers to embed Swing content into JavaFX applications. See the SwingNode javadoc and Embedding Swing Content in JavaFX Applications.
    • The new UI Controls include the DatePicker and the TreeTableView controls.
    • The javafx.print package provides the public classes for the JavaFX Printing API. See the javadoc for more information.
    • The WebView class provides new features and improvements. Review Supported Features of HTML5 for more information about additional HTML5 features including Web Sockets, Web Workers, and Web Fonts.
    • Enhanced text support including bi-directional text and complex text scripts such as Thai and Hindi in controls, and multi-line, multi-style text in text nodes.
    • Support for Hi-DPI displays has been added in this release.
    • The CSS Styleable* classes became public API. See the javafx.css javadoc for more information.
    • The new ScheduledService class allows to automatically restart the service.
    • JavaFX is now available for ARM platforms. JDK for ARM includes the base, graphics and controls components of JavaFX.
  • Tools
    • The jjs command is provided to invoke the Nashorn engine.
    • The java command launches JavaFX applications.
    • The java man page has been reworked.
    • The jdeps command-line tool is provided for analyzing class files.
    • Java Management Extensions (JMX) provide remote access to diagnostic commands.
    • The jarsigner tool has an option for requesting a signed time stamp from a Time Stamping Authority (TSA).
    • Javac tool
      • The -parameters option of the javac command can be used to store formal parameter names and enable the Reflection API to retrieve formal parameter names.
      • The type rules for equality operators in the Java Language Specification (JLS) Section 15.21 are now correctly enforced by the javac command.
      • The javac tool now has support for checking the content of javadoc comments for issues that could lead to various problems, such as invalid HTML or accessibility issues, in the files that are generated when javadoc is run. The feature is enabled by the new -Xdoclint option. For more details, see the output from running "javac -X". This feature is also available in the javadoc tool, and is enabled there by default.
      • The javac tool now provides the ability to generate native headers, as needed. This removes the need to run the javah tool as a separate step in the build pipeline. The feature is enabled in javac by using the new -h option, which is used to specify a directory in which the header files should be written. Header files will be generated for any class which has either native methods, or constant fields annotated with a new annotation of type java.lang.annotation.Native.
    • Javadoc tool
      • The javadoc tool supports the new DocTree API that enables you to traverse Javadoc comments as abstract syntax trees.
      • The javadoc tool supports the new Javadoc Access API that enables you to invoke the Javadoc tool directly from a Java application, without executing a new process. The javadoc tool now has support for checking the content of javadoc comments for issues that could lead to various problems, such as invalid HTML or accessibility issues, in the files that are generated when javadoc is run. The feature is enabled by default, and can also be controlled by the new -Xdoclint option. For more details, see the output from running "javadoc -X". This feature is also available in the javac tool, although it is not enabled by default there.
  • Internationalization
    • Unicode Enhancements, including support for Unicode 6.2.0
    • Adoption of Unicode CLDR Data and the java.locale.providers System Property
    • New Calendar and Locale APIs
    • Ability to Install a Custom Resource Bundle as an Extension
  • java.lang and java.util Packages
    • Parallel Array Sorting
    • Standard Encoding and Decoding Base64
    • Unsigned Arithmetic Support
  • JDBC
    • The JDBC-ODBC Bridge has been removed.
  • Networking
    • The class java.net.URLPermission has been added.
    • In the class java.net.HttpURLConnection, if a security manager is installed, calls that request to open a connection require permission.
  • Concurrency
    • Classes and interfaces have been added to the java.util.concurrent package.
    • Methods have been added to the java.util.concurrent.ConcurrentHashMap class to support aggregate operations based on the newly added streams facility and lambda expressions.
    • Classes have been added to the java.util.concurrent.atomic package to support scalable updatable variables.
    • Methods have been added to the java.util.concurrent.ForkJoinPool class to support a common pool.
    • The java.util.concurrent.locks.StampedLock class has been added to provide a capability-based lock with three modes for controlling read/write access.
  • HotSpot
    • Removal of PermGen.
    • Default Methods in the Java Programming Language are supported by the byte code instructions for method invocation.
  • Java Mission Control 5.3 Release Notes
    • JDK 8 includes Java Mission Control 5.3.