Notes

My latest writings


Monday, October 24, 2016

Java/J2ee Must Read - Interview Topics

Core Java:

OOPS

  •     Abstraction
  •     Encapsulation
  •     Polymorphism
  •     Inheritance

Overloading, Overriding

 

Exceptions

  •     Checked & Un-Checked exception
  •     Customizing Exception
  •     Exception chaining and propagation

Enum

  •     General concepts
  •     How to create and use

Threading

  •     Basics
  •     Thread vs Process
  •     Life Cycle
  •     Interrupting Threads
  •     Thread pool concept
  •     Concurrency (Good to have)
  •     Executor service

Collections & Maps

  •     ArrayList, LinkedList with code examples
  •     HashMap, Hashtable, ConcurrentMap detailed implementation knowledge
  •     Hash code, equals concepts
  •     Sorting collection & Maps,
  •     Searching elements in Collection and Maps
  •     Comparator/Comparable utilization

Inner classes

  •     Types of inner classes
  •     Difference with others

Generics

 

Design Patterns

  •     Singleton, factory, builder
  •     Adapter, Proxy, Facade
  •     Strategy, Observer, Chain of responsibility

Data structures

  •     Trees, Stack, Queue, Linked List

More...

  •     Arrays based programs
  •     Serialization vs Externalization
  •     Programs : like Singleton,Mutable class, Prime num, Febinnocii series, Sorting techniques, Hashmap implementation, String based programs,
  •     Object class methods with examples

Note: Features of all the versions Java 5, 6, 7 and 8



Advanced Java:

JDBC:

  •     Steps to write basic JDBC program
  •     Types of JDBC Drivers
  •     Difference b/w Statement, PreparedStatement, CallableStatemnt
  •     Result Sets
  •     Stored Procedures, Batch Processing
  •     Different interfaces used in JDBC program

Servlets:

  •     Lifecyle
  •     Request dispatcher
  •     ServletContext vs ServletConfig
  •     Different Scopes
  •     Session Tracking Mechanisms

JSP:

  •     Implicit objects
  •     Flow of excecution
  •     Session Tracking, Cookies
  •     JSTL
  •     Custom jsp tags
  •     Different types of tags available in JSP like Directives, Actions, etc.

Hibernate:

  •     What is ORM
  •     Hibernate object lifecycle
  •     Single row operations like get() vs load()
  •     Eager loading vs Lazy loading
  •     Annotations
  •     All the interfaces using in Hibernate programs like Session, SessionFactory, Transaction.. etc
  •     Cache like first level and second level cache
  •     Different types of mappings
  •     Hibernate features
  •     Difference b/w SQL, HQL, Criteria API, Native SQL

Spring:

  •     IOC, Spring Core
  •     Dependency Injection (DI) like Setter, Constructor, Interface
  •     Spring Bean Lifecycle
  •     Spring MVC flow of execution
  •     Autowiring
  •     Different Scopes
  •     Annotations
  •     AOP concepts in depth
  •     RESTful Webservices
  •     Transaction Management
  •     Spring integration with different frameworks like Hibernate, JSF, Tiles, Log4j, and etc.
  •     Spring Security


Saturday, August 22, 2015

Java 8 Features

1) New package (java.time) introduced

2) Arrays.parallelSort(fruits1); instead of Arrays.sort(fruits);

               bit fast the new one.

3) @Functional Interface newly introduces, it will recognize at compile time if interface have more than one abstract method.

@Functional
Interface public interface Demo {
public abstract void display();
public abstract void show();
}

4) A known bug with the way String.hashCode() for that given better solution.

     You can see that known bug with below stack overflow link.  Stack Overflow

the HashMap bucket uses a linked list to store the map entries. Using this algorithm, if there are a high number of collisions, then the complexity of the hash changes from O(1) to O(N). To resolve this, once the number of items in a bucket reaches a certain threshold, the bucket will switch to using a balanced tree algorithm in order to reduce the complexity to O(log n).

5) forEach (we can see this with below "lambda" feature in second example)

6) Lambda Introduction ("-> " is known as lambda expression.)

    When a Lambda expression is written, it is translated into a functional interface at compile time. Here is an example of using Lambda expressions to replace an anonymous inner class with much cleaner and more readable code.

Example 1:
//Old way without Lambda:
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
System.out.println(“Action Detected”);
}}
);

//New way with Lambda:
button.addActionListener(e -> {
System.out.println(“Action Detected”);
} );
Example 2: 
List<String> alphabets = Arrays.asList("A", "B", "C", "D");  
//Old:
for(String str : alphabets) {
System.out.print(str + "\t"); }
//New:
alphabets.forEach(str -> { System.out.print(str + "\t"); } );


Different ways: System.out.println("\n\nTo print using Lamda in Java 8 in more readable way using type:");
cities.forEach((String str) -> System.out.print(str + "\t"));
System.out.println("\n\nTo print using Lamda in Java 8 without using type but using \"value\":");
cities.forEach(value -> System.out.print(value + "\t"));
System.out.println("\n\nTo print using more concisely with :: operator:");
cities.forEach(System.out :: println);

Example 3:   
//sort by age 
Collections.sort(listDevs, new Comparator() {
@Override
public int compare(Developer o1, Developer o2) {
return o1.getAge() - o2.getAge();
}
});

//lambda
listDevs.sort((Developer o1, Developer o2)->o1.getAge()-o2.getAge());
//lambda, valid, parameter type is optional
listDevs.sort((o1, o2)->o1.getAge()-o2.getAge());

7) Replacement of PremGen with Metaspace

JDK 1.8 officially announced the removal of Permanent Generation (PremGen) space and in its place introduced Metaspace. In HotSpot VM, the PremGen used to give OutOfMemoryError due to depletion of space, may sometimes be caused by memory leaks while loading and unloading a J2EE applications.

In practice, the IBM JRE and Oracle JRockit are not using PremGen space and are using the native memory (C-Heap) to store a class’s metadata. This concept is taken into JDK 1.8 for Java VM.

From JDK 1.8, most of the memory allocation for storing metada is done through native memory. The existing classes used to retrieve the metadata of a class no more works with metaspace. By default, the metaspace allocation memory depends on the native memory availability, OS virtual memory availability and on JVM of 32-bit or 64-bit. A flag introduced to limit the maximum memory allocation for metaspace – MaxMetaspaceSize. If this flag is not set, the metaspace will dynamically updated, at intervals, as per the requirement of the application running.

The garbage collector is triggered to go for garbage collection when the metadata usage is more than the size of MaxMetaspaceSize.

Due to removal of PremGen space, we cannot configure the space through XX:PermSize & -XX:MaxPermSize

Works

What can I do


Branding

Social media Branding is far and away the best technique a company has to boost engagement with its customer base. Even a minimum of involvement, such as making one post a day.

Web Design

Web design is the process of creating websites. It encompasses several different aspects, including webpage layout, content production, and graphic design.

Development

Web Development refers to building, creating, and an maintaining websites. It includes aspects such as web design, web publishing, web programming and database management.

Graphic Design

Graphic design is the process of visual communication and problem-solving through the use of typography, photography, and illustration. The field is considered a subset of visual communication and communication design.

Photography

Photography is the art, application and practice of creating durable images by recording light or other electromagnetic radiation, either electronically by means of an image sensor, or chemically by means of a light-sensitive material such as photographic film.

User Experience

User experience (UX) design is the process design teams use to create products that provide meaningful and relevant experiences to users. This involves the design of the entire process of acquiring and integrating the product, including aspects of branding, design.

Contact

Get in touch with me


Adress/Street

Bangalore, India