Blog Archives
1 2

01: 14 Unix must-know interview questions & answers

Q1 How do you remove the Control-M characters from a file?
A1 Control-M is a carriage return on keyboard. The ^M is the keyboard equivalent to \r. In a file originated from DOS/Windows the \r\n is used for an end of line carriage return, whereas in Unix it is \n for a new line.

So, if created a file in DOS/Windows and copied it to a Unix machine, you need to convert the carriage returns from \r\n to \n. You need to remove \r.

Using the sed command that replaces Control-M with nothing

Tags: ,

Chrome Postman to test and debug RESTful Web Services

Step 1 You need to get the Postman extension for the Google chrome browser.

Step 2 Search and add POSTMAN.

Step 3 Once installed, open it from the Apps link.


Step 4 Set the TEST URL, HTTP headers (especially the content type application/json, etc), and HTTP method (GET, POST, PUT, etc) and then click on send.



for the completeness, the REST service could have been implemented using Spring MVC, and the controller implementation looking like

Debugging JAR hell issues in Java

The following 3 questions are frequently asked by Java developers as an industrial strength Java project will have 100+ jar files. How often have you come across a Java application that requires different versions of the same library? How often do you see exceptions like NoSuchMethodError or IllegalArgumentException. Here are some tips to solve the JAR hell problem. These 6 tips will go a long way in resolving your jar problems.

Q1. Which Jar has a particular class?

Tip #1: Go to and search for the class file. For example, I want to find the jar file that …

Debugging like a pro with eclipse IDE tutorial for Java developers

Often you get to work on a fully functional Java application that is already in production to fix production issues or to enhance its existing functionality. As a new Java developer in the team, it is not easy to get started and contributing. The approach would be slightly different from working on a brand new project. Here are a few tips that will help you hit the road running as quickly as possible.

This post will also help you answer a common developer interview question —

Q. How will you hit the road running fast on an enhancement or …

Debugging SSL issues in Java & tools to debug

Q1. What are some of the issues you encounter with SSL handshake? A1. Some of the issues you try to debug are Presence of a valid certificate in trust store Incorrect certificate chains in the client or server truststore Invalid key algorithm used for private keys Expired certificate Incorrect passwords…

Handy DOS commands for Java developers

Q. How will you copy files more robustly in DOS? A. Using the Robocopy (stands for Robust File Copy) or Xcopy command line utilities. Check for its options with “robocopy /?”. Q. How will you remotely connect to a remote Windows or NT server? A. You can use the “mstsc”…

How to perform impact analysis across Java based applications?

Performing impact analysis is a crucial software development task. It is all about calculating the impact of software change.

Q1. What is an impact analysis? Is it a trivial task?
A1. An impact analysis is about being able to tell which pieces of code, packages, modules, and projects get impacted by a change.

Performing an impact analysis is not a trivial task, and there is not a single tool that can cater for every scenario. You can make use of some static analysis tools like IDEs (e.g. eclipse), JRipples, X-Ray, etc. But, unfortunately applying just static …

JMeter beginner tutorial

This tutorial performance test the RESTFul web service we created ealier as part of the “RESTful Web Service Tutorial with Apache CXF, Maven, and Eclipse” with JMeter. JMeter is an opensource performance testing tool.

Step 1: Download latest release version of Apache JMeter from ““, and unzip it into c:\tools folder or folder of your choice. Double click on jmeter.bat under the bin folder. For e.g. C:\TOOLS\apache-jmeter-2.11\bin\jmeter.bat

Step 2: Make sure that the RESTful web service is deployed to Tomcat and running as per the instructions on the tutorial “”RESTful Web Service Tutorial with Apache CXF, Maven, and …

Notepad++ beginner tutorial

You can download Notepad++ from It is a very handy productivity boosting tools. Q. Why is Notepad++ is a very handy tool? A.  Notepad++ is a very handy developer tool. Here are some of the productivity benefits of Notepad++. to view source code as a free and light weight…

Notepad++ productivity tips with SQL trigger code example

One of the traits of good developers is that being lazy and this laziness leads to finding productive ways to perform a task. Recently, I had to create a number of triggers to a few existing tables. It is quite a repetitive task, hence I decided to use notepad++ regex…

Notepad++ to construct SQL where clause

Let’s take a tutorial like scenario to demonstrate power of Notepad++ as a developer productivity tool.

This approach can be used in other text editors like sublime, atom, etc that support regular expression (i.e regex) based find & replace.

Q. How will you extract rule_name values from a tabular data shown below and convert it to a comma separated values that can be used in an SQL WHERE clause.

Tabular data

Power of Excel spreadsheet to dynamically generate SQL

When you have some data in tabular (e.g. Excel spreadsheet) format and would like to insert into a database table, you need to write an SQL insert query. Manually writing SQL query for multiple records can be cumbersome. This is where Excel spreadsheet comes in handy as demonstrated below. A single SQL query can be copied down where the formulas get copied with incrementing column numbers.

The  Excel concatenate character & is used to achieve this. The $ means fix. $a1 means fix excel column A. When you copy the formula, the row numbers will be incremented like 2,3,4, etc, …

Power of SQL as a productivity tool

There are times where you need to generate “INSERT” SQL statements from existing data. For example, you may have a production release ready “Delete” SQL statement as shown below to remove some existing records.

For this script, you need to have a rollback script to insert the values back…

sed and awk to write shell scripts for Java developers

Q. How would you go about replacing a piece of a text or a phrase from 20,000+ web templates residing on a Unix file system? Even some candidates with 5+ years of experience will be tempted to spend a day or two to write 200+ lines of code to achieve…

Source control system and subversion (aka SVN) Q&A

Q. Why do you need a source control system? A. Source Control systems like subversion is a must if you are writing Java code by yourself or as a team. It allows multiple streams of coding, tracks the changes in your code and allows you to roll back to previous…

Splunk to analyse Java logs and other machine data

Q1. What is Splunk and where will you use it?
A1. Splunk is an enterprise-grade software tool for collecting and analyzing “machine data” like log files, feed files, and other big data in terra bytes. You can upload logs from your websites and let Splunk index them, and produce reports with graphs to analyze the reports. This is very useful in capturing start and finish times from asynchronous processes to calculate elapsed times. For example, here are the basic steps required.

Step 1: log4j MDC logging can be used to output context based logs and then
Step 2:

Top 10 Eclipse short-cut keys every Java developer using eclipse IDE must know

1. CTRL+1

Probably the most useful one. It activates the quick fix and generates lots of code for you. This means less typing.

Generating local variables: For example, if you have written a method call and you highlight it and press Ctrl+1, Eclipse will give you options to extract to local variable, assign to new local variable or assign to new field.

If you’ve modified a method in a abstract superclass or interface and you highlight the subclass’ name and hit Ctrl+1, you’ll get options to add unimplemented methods or make the subclass abstract.

Suppose you’ve misspelled “currentTimeMillis”, …

Top 7+ Java productivity tools that make your life easier as a Java developer

In today’s enterprise Java development, you will use plethora of tools to make your life easier and more productive. The open-ended questions described below are not to make the Hire/No Hire decision, but to judge your seniority and experience. Q. Can you describe some real life scenarios in which tools…


Unix history commands for Java developer productivity

When you are using Linux/Unix command line frequently, using the history effectively can be a major productivity boost. You can accomplish things with less typing. For example, you will be typing lots of commands like

and so on. There are 6 ways to repeat your previous commands quickly without having to type a lot.

  1. Use the up arrow to view the previous command and press enter to execute it.
  2. Type !! and press

Unix remoting interview Q&A for Java developers

Q1 How will you delete files that are older than 7 days in a remote unix server? A1 By ssh ing to the remote host server

Q2 How will you copy files from a remote server to a local server? A2 By scp ing (i.e. secured copying) to the…

1 2

300+ Java & Big Data FAQs - Quick Prep

Java & Big Data Tutorials