Blog Archives

♥ ♦ Java coding practice problems – prime and powerful

There is no other way to pass the Java coding tests other than practicing. I have failed Java coding tests due to lack of practice. How often do you get work with tree and graph data structures? Ho often do you work with algorithms?

50+ Java coding practice problems Links:

Can you write code in Java?

Read more ›

Tags: ,

♥ 14 Unix interview questions & answers for Java developers

Q1 How do you remove the Control-M characters from a file?
A1 Using the sed command that replaces Control-M with nothing

Note: The ^M is typed on the command line with ctrl+v and ctrl+M

Q2 How will you search for a property named “inbox”

Read more ›

Tags: ,

♥ 5 steps to become a freelance Java developer to gain professional freedom

Anyone can become a freelance Java developer, but the hardest part of being a freelancer is finding not just any freelancing Java jobs but rewarding & longer term freelancing Java development work and continuously finding them without any prolonged gaps.

You just can’t go to a freelance site like Elance.com or Odesk.com and expect to pull jobs that will give you a steady and attractive income.

Read more ›

Tags:

♥ 5 tips that will put your Java contracting career on auto-pilot mode

If you are already working as a Java freelancer/contractor or aspiring to become one, here are 5 tips that will put your freelancing career as a programmer on auto-pilot mode. Feel free to share your experience and tips as a freelancer. If you aspire to become a freelancer/contractor then read 5 steps to become a Java freelancer

3 key benefits of contracting/freelancing

1) Better income,

Read more ›

Tags: ,

♥ 6 Aspects that can motivate you to fast-track your career & go places as a software engineer

#1: Nitty-gritty reasons like insult, failure, professional embarrassment, and lack of respect. For example,  not getting the job you badly wanted,  being unemployed for a while, leaving a job in unpleasant circumstances, etc. There is no better way to get even with those caused this to you than proving yourself with a success.

Read more ›

Tags:

♥ 9 Tips to earn more as a Java developer

Not all jobs and titles are created equal. Why do person “X” and person “Y” performing similar tasks have a difference of 1.2 to 2.0 times in their remunerations? Why do low latency & big data jobs tend to pay more? Why are specialists get paid more than the generalists?

Read more ›

Tags: ,

♥ Beginner array coding problems in Java

More Data Structure and Algorithms Coding Questions and answers in Java.

Q1. Write a program that allows you to create an integer array of 5 elements with the following values: int numbers[ ]={5,2,4,3,1}. The program computes the sum of first 5 elements and stores them at element 6,

Read more ›

Tags: ,

♥ Choosing from multiple Java job offers – analytical approach

The top 4 career mistakes many make as a software developer are:

1) Stagnating in the same job without acquiring the much needed technical & soft skills. False sense of job security that the employer will look after me and staying too long in the comfort zone without expanding on the stack of technoligies will come back and bite you.

Read more ›

Tags:

♥ Creating a simple Java Web project with Maven – part 1

Java beginners to create a simple web application (i.e. a Web ARchive filei.e. a war file). Prerequisite is that you have set up Java, Maven, and Eclipse.

 Step 1: Execute the Maven maven-archetype-webapp command to create the Maven web structure with the following command on a DOS command prompt.

Read more ›

Tags:

♥ Didn’t get the job offers or raise you deserve as a Java developer?

Your CV didn’t get short listed; you didn’t get the job you hoped for; you didn’t get the raise you deserved. Don’t be afraid of failures because
.

“Edison failed 10, 000 times before he made the electric light. Do not be discouraged if you fail a few times.”

Read more ›

Tags:

♥ Is the effort you expend on Java certification worth the results?

If you expect to land your dream developer job simply by having a Java certification then it is probably a naive thinking. Preparing for the exam makes you learn the language basics, and keeps you motivated in getting the certification. The real world out there is quite different and requires the programmer mindset to solve problems and good career skills to go places.

Read more ›

Tags:

♥ javap for debugging and better understanding some Java concepts with 3 practical examples

The javap is a class file dissembler. Here are 3 scenarios you can put javap to use with code examples.

#1 Finding the Java version of the class file within a jar

Extract a class file say “MyJobRunner.class” from a jar file and use javap to find out the version used

“major version: 51”

Read more ›

Tags:

♥ Spring 3.0 tutorial – Part 1 (Setter DI )

This is a very simple Spring setter DI (depenendency injection tutorial). This assumes that you have gone through the “Setting up Java, Maven and Eclipse” tutorial. To recap:

1) Java, Maven, and eclipse are set up.
2) You have run the Maven archetype:generate command to create a skeleton structure.

Read more ›

Tags:

♥ Spring lookup-method example to inject prototype scoped bean into a singleton scoped bean

Step 1: You need asm and cgilib libraries in addition to Spring libraries shown below.

spring-lokkup-needs-asm-cgilib

Step 2: define the Dao (Data Access Object) interface.

Step 3: Define the Dao implementation.

Read more ›

Tags:

♥ Top 10 causes of performance issues in Java

Cause #1: The JVM spends more time performing garbage collection due to

  • improper Garbage Collection (GC) configuration. E.g. Young generation being too small.
  • Heap size is too small (use -Xmx). The application footprint is larger than the allocated heap size.

Read more ›

Tags: , ,

♥ Unit Testing Data Access Logic in Java

Most interviewers like Java candidates those who are passionate and experienced about writing unit tests. Any non trivial Java application will be making calls to database tables. So, here are a few questions and answers testing your ability to write unit tests to test data access layer.

Q1.

Read more ›

Tags:

♥ What are the 16 technical key areas of Java programming to fast-track your career?

What are the 16 technical key areas?

If you want to become a Java Application Architect, then you must have good handle on these 16 technical key areas. Not only the architects, but also seasoned Java developers must have a good understanding &

Read more ›

Tags:

♥ When to jump the ship? Vs When to steady the ship?

One of the dilemmas many professionals face is when to jump the ship? versus when to steady the ship? There is no right or wrong answer to this question, and the answer depends on the individual circumstances. But here are some of my thoughts that might aid in your decision making.

Read more ›

Tags:

♥♦ Part 1: Badly designed Java classes & interfaces

4 Part practical design concept series

Part 1: Abstraction | Part 2: Single Responsibility Principle | Part 3: Open Close Principle | Part 4: Dependency Inversion Principle.

Read more ›

Tags: ,

♦ 14+ SQL interview Questions & Answers

SQL interview Questions & Answers is a must for any developer as all non-trivial applications need to talk to a database with CRUD operations. Q3 is the most popular. Q1. Can you explain DDL statements in regards to SQL? A1. … Read more ›...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

45-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home
Tags: , , , ,

♦ Processing large files efficiently in Java – part 1

Q1. What are the key considerations in processing large files?
A1. Before jumping into coding, get the requirements.

#1 Trade-offs among CPU, Memory Usage & Disk I/O

Processing a file involves reading from the disk, processing (e.g. parsing an XML and transforming), and writing back to the disk.

Read more ›

Tags:

01: ♥♦ Spring DI & IoC interview Q&As

Video: Spring DIP, DI, and IoC. This extends 13 Spring interview questions & answers.

Q1. What do you understand by the terms Dependency Inversion Principle (DIP), Dependency Injection (DI) and Inversion of Control (IoC) container?

Read more ›

Tags: , , , ,

01: ♦♥ 17 Java overview interview questions and answers

Q1. Why use Java?
A1. One needs to use the best tool for the job, whether that tool is Java or not. When choosing a technology to solve your business problems, you need to consider many factors like development cost, infrastructure cost, ongoing support cost,

Read more ›

Tags: , , ,

02: ♥♦ Java Compile-time Vs Run-time Interview Q&As

During development and design, one needs to think in terms of compile-time, run-time, and build-time. It will also help you understand the fundamentals better. These are beginner to intermediate level questions.

Q1.

Read more ›

Tags: ,

02: ♥♦ Java Generics in no time “? extends” & “? super” explained with a diagram

Generics in Java can be be a bit tricky to get your head around. Hope the explanation below enhances your understanding of generics. This complements 5 Java generics interview Q&As with examples.

Plain old List, List <Object>, and List<?>

The plain old List: is a heterogeneous mixture or a mixed bag that contains elements of all types,

Read more ›

Tags: ,

02: ♥♦ What is wrong with this code? Heap Vs Stack, Thread safety & Synchronized

This post covers must know Java Multithreading basics – Heap Vs Stack, Thread-safety & Synchronization. When you have a multithreaded Java application, you need to code in a thread-safe manner. Java interviewers may ask you to detect thread-safety issues as discussed in “What is wrong with this code?

Read more ›

Tags: ,

03: ♥♦ Java autoboxing & unboxing benefits & caveats interview Q&As

Q1. What do you understand by the terms “autoboxing” and “autounboxing” in Java?
A1. Java automatically converts a primitive type like “int” into corresponding wrapper object class Integer. This is known as the autoboxing. When it converts a wrapper object class Integer back to its primitive type “int”,

Read more ›

Tags: ,

03: Identifying and fixing NonUniqueObjectException in Hibernate

NonUniqueObjectException is thrown when there is an object already associated with the session with the same id (primary key) (i.e. a duplicate). It is important to understand the concept of a “detached” object in Hibernate. This is one of the most common errors, understanding why and when this error is thrown will save you time in identifying and fixing this issue.

Read more ›

Tags:

04: Identifying and fixing LazyInitializationException in Hibernate

LazyInitializationException is thrown when an object becomes detached, and if you try to access associated (i.e. proxied) object(s) of a detached object.

Q. What is a detached object in Hibernate?

When you close an individual Hibernate Session, the persistent objects you are working with are detached.

Read more ›

Tags:

04: ♥ Merging Vs rebasing on Git questions and answers

Q1. What do you understand by the terms merging and rebasing? Can you explain both with a daiagram?
A1. Both of these commands are designed to integrate changes from one branch into another branch—they just do it in very different ways.

Read more ›

Tags:

04: ♦♥ 5 FAQs on transforming your thinking from OOP to FP

One needs to get used to the transformation from imperative programming to functional programming. You like it or not, you will be using functional programming in Java, and interviewers are going to quiz you on functional programming. Fortunately, Java is not a fully functional programming language,

Read more ›

Tags: ,

05: ♥ 12 things to know about Java (or any) job interviews

1. Interviews are not technical contests to see who gets the most number of questions right. so, don’t be overwhelmed by the number of Q&A on this site. 4 things to watch-out for are:

  • Getting through the initial telephonic & written/coding test screening,

Read more ›

Tags:

05: ♥ Git & Maven for releasing software artifacts Q&A

Q1. What are the general steps involved in making a software release?
A1.

#1: Checking out the software artifacts to you build serevr or local box from a source control management (i.e. SCM) system.

#2: Giving it a version so it can be uniquely identifieds

#3: Building,

Read more ›

Tags:

05: ♥ Overloaded methods Vs Generic methods in Java with JD-GUI & javap to look under the covers

In an earlier post we looked at Understanding Overriding, Hiding, and Overloading in Java?. We also discussed how “method overriding” gives polymorphism. In this post, let’s see how a “generic method” can replace a number of overloaded methods. Then see under the hood as to what happens to the compiled code.

Read more ›

Tags:

06: ♥ Java 8 way of File reading and functionally processing the data

Output:

#1 double colon notation ::

The new double colon (::) operator that Java 8 has to convert a normal method into lambda expression. So,

Instead of:

You can do:

#2 Why is stream::iterator used?

Read more ›

Tags:

06: ♥♦ HashMap & HashSet and how do they internally work? What is a hashing function?

HashMap & HashSet are not only one of the frequently used data structures, but also one of the popular interview topics.

Q1. How does a HashMap store data?
A1. As key/value pairs. You can store and retrieve values with the keys.

Read more ›

Tags: ,

07: ♥ Java Iterable Vs Iterator differences and know how

Q1. What are the differences between Iterator<T> Vs Iterable<T>?
A1. The “Iterable” was introduced to be able to use in the “foreach” loop. A class implementing the Iterable interface can be iterated over. For example,

Hence, it can be used in the foreach loop

The Iterable interface has one method iterator()

So,

Read more ›

Tags:

3 reasons to become a Freelance Java Developer

This is mainly based on working as a freelance Java developer for a single client on a contractual basis like 6 to 24 months or longer, and not working on smaller jobs for multiple clients. Whilst there are premium Java freelancing sites like “toptal.com“,

Read more ›

Tags:

Are you reinventing yourself as a programmer?

Reinventing yourself is all about constantly embracing change. It also means being selfish and looking after yourself. Most people dislike or even fear change, but want things to “get better” in terms of promotions, salary, job satisfaction, not feeling stagnated, being recognized, and having a job security.

Read more ›

Tags:

Q1-Q10: ♥♦ Top 50+ Core Java Interview Questions and Answers

50+ Core Java interview questions answered for freshers to experienced Java developers. These FAQs have drill down links to more must know Core Java Interview Q&As.

Q1. What is the difference between “==” and “equals(…)” in comparing Java String objects?
A1. When you use “==” (i.e.

Read more ›

Tags: , , , ,

Top 6 tips to go about writing loosely coupled Java applications

6 tips to go about writing loosely coupled Java applications useful not only for talking the talk in Java job interviews, but also to build maintainable Java applications.

Q1. What is tight coupling?
A1. If class OrderServiceImpl relies on parts of class PaymentServiceImpl that are not part of interface PaymentService,

Read more ›

Tags: , , ,

By topics – 800+ Q&As ♥ Free ♦ FAQ

open all | close all

Java 200+ FAQs – Quick Brushup

open all | close all

100+ Java Tutorials step by step

open all | close all

13+ Tech Key Areas to standout

open all | close all

Java coding exercises

open all | close all
Top