## Java Interview Questions

- 0of 0 votes
You are given a list of strings

/flapp/server/apache

/d/apps

/d/apps/pub

/flapp

/flocal/firms

/d/sw/java

/d/sw/orcl/jdbc

The filtered strings shoud be

/flapp

/d/apps

/d/sw/java

/d/sw/orcl/jdbc

/flocal/firms

You have to identify the problem/requirement and provide solution that can work for any input with similar pattern.

- 0of 0 votes
I have interview with Ericsson:

Working knowledge of server-side JavaScript

Working knowledge of WSDL, XSD and XML

Working knowledge of workflow concepts such as BPM, BPMN, BPML and BPEL.

Working knowledge of HTML

Working knowledge of integration technologies/frameworks including AXIS, SOAP, JMS, HTTP, Socket, FTP, SMTP/POP and integration platforms (EAI, ESB, BPI) such as JMS, MQ, WLI and Tibco

Good design skills

please help if anyone gone through interview process of Ericson.

- 0of 0 votes
A program that prints all combinations of a n letter word without using recursion technique.

Example :

Word : abcd

abcd

bacd

cabd

acbd

bcad

cbad

dbac

bdac

adbc

dabc

badc

abdc

acdb

cadb

dacb

adcb

cdab

dcab

dcba

cdba

bdca

dbca

cbda

bcda

- -1of 1 vote
Having A List of int [1,1,1,3,1,2,1,1,4,1]

Output needed [1,5,6,3,7,2,8,9,4,10]

Note: Need not to change value of 3,2,4

- 0of 0 votes
Implement a Singleton class in java? How will this help?

- 0of 0 votes
A server receives requests from different clients...each client send a Runnable job and time on which this job should be run. Write a java program that would accept these jobs and run each job at the required time. Hint: the solution should have a job priority queue to hold the jobs and it should be multithreaded. One thread should accept the tasks, the other one should run the jobs. Also conditions and signalling will be used

- 1of 1 vote
You have a class that many libraries depend on. You need to modify the class for one application. Which of the following changes require recompiling all libraries before it is safe to build the application?

a. add a constructor

b. add a data member

c. change destructor into virtual

d. add an argument with default value to an existing member function

- 0of 0 votes
Do thread join without join function?

- 0of 0 votes
how to sent buffer limit in BufferedReader/ BufferedWriter class

- 0of 0 votes
How to implement thread safety in java without using synchronized method?

- 0of 0 votes
Chinese chess has 8*8=64 cells.And the point is (1,1),ï¼ˆ1ï¼Œ2ï¼‰,..............(8,8ï¼‰.And the horse walks by diagonal line of two cells from where point it is.Calculate the shortest step(s) between two points for the horse to walk. Eg. (1,1) to (4,4). Horse go like this (1,1)>(2,3)>(4,4)

- 0of 0 votes
Chinese chess has 8*8=64 cells.And the point is (1,1),ï¼ˆ1ï¼Œ2ï¼‰,..............(8,8ï¼‰.And the horse walks by diagonal line of two cells.Calculate the shortest step(s) between two points for the horse to walk. Eg. (1,1) to (4,4). Horse go like this (1,1)>(2,3)>(4,4)

- 0of 0 votes
Write a program to read file of following data structure: Name: favcolor=blue Find out which color is favorite by most people (print the color and number of people)

- 1of 1 vote
Write a Java program to find out minimum numbers from fibonacci series required such that sum of numbers should be equal to a given Number N?

Note : repetition of number is allowed.

Example1.

N= 7;

answer = 2 (5 + 2 = 7)

Example 2.

N = 70;

Answer = 3 (34 + 34 + 2)

- 0of 0 votes
Given an array of paper products in which each product has an attribute name, width, and height, and given a sheet of paper that has width xx and height yy, write a program that returns the number of sheets of paper needed to print out the array of paper products

- 1of 3 votes
Write a program to implement Double Linked List from Stack with min. complexity.

- -1of 1 vote
How to implement split () method

- -1of 1 vote
How to implement split () method

- -1of 1 vote
Write a program to split a string without using split()method

- 0of 0 votes
Given a string .Check if the string is palindrome or not

- 2of 2 votes
The stepping number:

A number is called as a stepping number if the adjacent digits are having a difference of 1. For eg. 8,343,545 are stepping numbers. While 890, 098 are not. The difference between a â€˜9â€™ and â€˜0â€™ should not be considered as 1.

Given start number(s) and an end number(e) your function should list out all the stepping numbers in the range including both the numbers s & e.

- 0of 0 votes
Given two classes C1 and C2 which are almost same.(remember not exactly same).

You want to choose best among these classes so that it can be use as key in hashmap.

What question will you ask regarding two classes C1 and C2.

- 0of 0 votes
What is the diffenrce between join() and wait()?

What is sleep(). Which method releases the lock?

- 0of 0 votes
How can we implement asynchronous call in Java? Say I want to query Google but donâ€™t want to use all the urls want to use later. How can we do that?

- 0of 0 votes
How can we divide a large file between multi threads to process it? If we are running a multi threaded application and input is a large file and we have to provide each thread a part of the file to make it fast. How we can achieve it in java?

- 0of 0 votes
If we have all the variables and methods are as static. So would that class be thread safe?

- 0of 0 votes
Judgement Day

Skynet has figured out a way to take over the world. It will keep producing robots and molecular assemblers until it has converted all matter for its own purpose. Robots work to produce more robots and molecular assemblers. Molecular assemblers convert matter into programmable matter to be used to produce more robots and molecular assemblers.

Initial Info On day 0, Skynet started with 3 robots, 1 molecular assembler and 0 units of programmable matter.

On day i (i>0), robots produced can be calculated as the sum of the robots produced on the previous day and thrice the units of programmable matter produced on the previous day.

On day i, number of molecular assemblers produced can be calculated as the sum of robots produced on the previous day and twice the units of programmable matter produced on the previous day.

On day i, the units of programmable matter produced can be calculated as five times the number of molecular assemblers produced on the previous day.

How many robots, molecular assemblers and units of programmable matter will be produced on the Judgement Day (day n)?

Input/Output Specifications

Input format: Two integers x and y (1<=x,y<=10^6) such that the judgement day falls on day n = x*y.

Output format: Since the number of robots, molecular assemblers and units of programmable matter grows very rapidly, we want you to output them modulo 1000000007.

The output should be a string having the following format: R#M#P, where - R is the number of robots produced on judgement day modulo 1000000007 - M is the number of molecular assemblers produced on judgement day modulo 1000000007 - P is the number of units of programmable matter produced on judgement day modulo 1000000007

- 0of 0 votes
Distributing Medals It's the medal distribution ceremony. 10^6 police officers, numbered from 1 to 10^6, are standing in a line. There are N (1<=N<=1000) iterations of medal distribution. In iteration i (0 < = i < N), count[i] ( 1 < = count[i] < = 100) medals are given to all officers from from[i] to to[i] ( 1 < = from[i] < = to[i] < = 10^6 )

If we sum up the number of medals received starting from the first officer, who would be the first officer for which the cumulative sum exceeds a given medal count THRESHOLD ( 1 < = THRESHOLD < = 10^9 )?

Input/Output Specifications Input format:

You are given 5 inputs:

input1 = N, the number of iterations

input2 = count, the array of medal counts in each iteration

input3 = from, the array of starting indices in each iteration

input4 = to, the array of ending indices in each iteration

input5 = THRESHOLD, the medal count threshold

Output format:

An integer, representing the number of the first officer such that the cumulative sum of medals starting from the first officer upto this officer exceeds THRESHOLD. The output should be -1 if such an officer does not exist

- 0of 0 votes
Judgement Day

Skynet has figured out a way to take over the world. It will keep producing robots and molecular assemblers until it has converted all matter for its own purpose. Robots work to produce more robots and molecular assemblers. Molecular assemblers convert matter into programmable matter to be used to produce more robots and molecular assemblers.

Initial Info On day 0, Skynet started with 3 robots, 1 molecular assembler and 0 units of programmable matter.

On day i (i>0), robots produced can be calculated as the sum of the robots produced on the previous day and thrice the units of programmable matter produced on the previous day.

On day i, number of molecular assemblers produced can be calculated as the sum of robots produced on the previous day and twice the units of programmable matter produced on the previous day.

On day i, the units of programmable matter produced can be calculated as five times the number of molecular assemblers produced on the previous day.

How many robots, molecular assemblers and units of programmable matter will be produced on the Judgement Day (day n)?

Input/Output Specifications

Input format: Two integers x and y (1<=x,y<=10^6) such that the judgement day falls on day n = x*y.

Output format: Since the number of robots, molecular assemblers and units of programmable matter grows very rapidly, we want you to output them modulo 1000000007.

The output should be a string having the following format: R#M#P, where - R is the number of robots produced on judgement day modulo 1000000007 - M is the number of molecular assemblers produced on judgement day modulo 1000000007 - P is the number of units of programmable matter produced on judgement day modulo 1000000007

- 0of 0 votes
Write a java program read 3 numbers and line length make triangle..find whether triangle is isosceles or equilateral triangle,also find out rightangle triangle?