Thales Android Interview


1) Difference between Service and Aysnc Task.
2) What is Broadcast Receiver and when to use one.
3) What is fragment
4) Tell the activity lifecycle
5) Why do we use DDMS
6) adb commands used by you


1) What is static method
2) What values can be accessed from a static method in java


1) Git command to add a file

2) Difference between git pull rebase vs git pull merge

1) Difference between inner join and full join


1) How to send a file from computer to server
2) What is ssh command

1) List the top 10 process which are taking most CPU.

Rounding off double to specified number of digits

You can’t set the precision of a double (or Double) to a specified number of decimal digits, because floating-point values don’t have decimal digits. They have binary digits.

You will have to convert into a decimal radix, either via BigDecimal or DecimalFormat, depending on what you want to do with the value later.

DecimalFormat df = new DecimalFormat("#.####");
for (Number n : Arrays.asList(12, 123.12345, 0.23, 0.1, 2341234.212431324)) {
    Double d = n.doubleValue();
You can try BIGDECIMAL for this purpose

Double toBeTruncated = new Double("3.5789055");

Double truncatedDouble = new BigDecimal(toBeTruncated)
    .setScale(3, BigDecimal.ROUND_HALF_UP)

CS General Concepts

1) What is POSIX?

The Portable Operating System Interface (POSIX)[1] is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines the application programming interface (API), along with command line shells and utility interfaces, for software compatibility with variants of Unix and other operating systems.