Interview Questions

Q:

How to identify a given positive decimal number as even/odd without using % or / operator ?

Answer

You may be very good at coding,but if you questioning how on earth you could solve this problem.Then here is a solution. If you remember the good old days of our primary school then the solution is easy,"division is a matter of iterative subtraction".


public class TestEvenOdd {
public static void main(String arg[ ]){
int num=6;
int result=num;
while(result>=2){
result=result-2;
}
if(result==1){
System.out.println("The number is odd");
}else{
System.out.print("The number is even");
}
}
}

Report Error

View answer Workspace Report Error Discuss

Subject: Java

3 5494
Q:

Give an example for the use of volatile keyword in c++ ?

Answer

Most of the times compilers will do optimization to the code to speed up the program. For example in the below code,


int k = 15;
while( k == 15)


{
// Do something
}


compiler may think that value of 'k' is not getting changed in the program and replace it with 'while(true)', which will result in an infinite loop. In actual scenario, the value of 'k' may be getting updated from outside of the program.


Volatile keyword is used to tell compiler that the variable declared using 'volatile' may be used from outside the current scope, so that compiler won't apply any optimization. This matters only in case of multi-threaded applications.


In the above example if variable 'k' was declared using volatile, compiler will not optimize it. In shot, value of the volatile variables will be read from the memory location directly.

Report Error

View answer Workspace Report Error Discuss

5 5481
Q:

What items are important in every Android project?

Answer

 These are the essential items that are present each time an Android project is created:


- AndroidManifest.xml


- build.xml


- bin/


- src/


- res/


- assets/

Report Error

View answer Workspace Report Error Discuss

7 5481
Q:

What is account payable? How we pass the entries in account payable and related all the question based on account payable?

Answer

Accounts Payable is a short term liability of an organization. It's a process by which a company buys goods and services on credit and is billed in the form of an invoice, which states the terms and conditions of the payment. Accounts Payable is recorded as a current liability in the balance sheet. All accounts paayble entries are to be coded under the right G/L accounts to have an accurate picture of the company's short term liability.

Report Error

View answer Workspace Report Error Discuss

Subject: Accounts Payable

4 5462
Q:

Which of the following are elements of SQL?

A) base-table-identifier ::= user-defined-name B) base-table-name ::= base-table-identifier
C) boolean-primary ::= comparison-predicate D) All the above
 
Answer & Explanation Answer: D) All the above

Explanation:
Report Error

View Answer Report Error Discuss

2 5455
Q:

What is Treasury Bills?

Answer

A Treasury Bill (known as T-Bill) is an instrument of money market, used to finance short term requirements of Government of a country. A T-Bill is issued at a rate lower than the Face value, and redeemed at Face value on maturity, this difference is the rate of interest on T-Bill. This rate of interest is called Risk free Rate of the country.


 

Report Error

View answer Workspace Report Error Discuss

Subject: Finance

2 5450
Q:

A co-worker is rude to customers, what would you do?

Answer

That would depend on what kind of a rapport I had with him. If I felt comfortable, I would probably mention that being rude is probably going to be bad for him in the long run, since unhappy customers reflect badly on the sales associate. Otherwise, I would mention to the supervisor what I had witnessed, and let him handle it.

Report Error

View answer Workspace Report Error Discuss

6 5445
Q:

What is a key field in an IMS database?

Answer

A Field that DL/I uses to maintain the segments in the ascending order is called the key field

Report Error

View answer Workspace Report Error Discuss

2 5440