Interview Questions

Q:

What is Aggregate Functions?

Answer

Aggregate functions perform a calculation on a set of values and return a single value. Aggregate functions ignore NULL values except COUNT function. HAVING clause is used, along with GROUP BY, for filtering query using aggregate values.


Following functions are aggregate functions. 


AVG, MIN CHECKSUM_AGG, SUM, COUNT, STDEV, COUNT_BIG, STDEVP, GROUPING, VAR, MAX. VARP

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 2194
Q:

What CICS command are used to read a VSAM KSDS sequentially in ascending order?

Answer

READNEXT reads the next record from a browse operation for any of the three VSAM files.

Report Error

View answer Workspace Report Error Discuss

0 2193
Q:

Data structure suitable for an application discussed in?

A) procedural design B) architectural design
C) data design D) interface design
 
Answer & Explanation Answer: C) data design

Explanation:
Report Error

View Answer Report Error Discuss

1 2192
Q:

Client code having direct access to internal data is called

A) Encapsulation B) DataHiding
C) Polymorphism D) DataAbstraction
 
Answer & Explanation Answer: B) DataHiding

Explanation:

Client code must use setters and getters to access internal data in DataHiding

Report Error

View Answer Report Error Discuss

Filed Under: Java

0 2191
Q:

Explain how PL/SQL exceptions are raised.

Answer

PL/SQL exceptions are raised using the RAISE command. This command is used when exceptions are defined by programmer and not implicit exceptions.


 


Example:


Declare and raising an exception:


DECLARE


short_of_attendance EXCEPTION;


min_attendance NUMBER(4);


BEGIN


...


IF min_attendance < 10 THEN


RAISE short_of_attendance;


END IF;


EXCEPTION


WHEN short_of_attendance THEN


-- handle the error


END;

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 2190
Q:

Write a method to fill all the spaces in a string with '%20'

Answer

public class Test {


    public void replaseSpaces(char[] str, int length) {


        int spaceCount = 0, newLength = 0, i = 0;


        for(i = 0; i < length; i++) {


            if (str[i] == ' ') 


                spaceCount++;


        }


 


        newLength = length + (spaceCount * 2);


        str[newLength] = '\0';


        for(i = length - 1; i >= 0; i--) {


            if (str[i] == ' ') {


                str[newLength - 1] = '0';


                str[newLength - 2] = '2';


                str[newLength - 3] = '%';


                newLength = newLength - 3;


            }


            else {


                str[newLength - 1] = str[i];


                newLength = newLength - 1;


            }


        }


        System.out.println(str);


    }


 


    public static void main(String[] args) {


        Test tst = new Test();


        char[] ch = {'t', 'h', 'e', ' ', 'd', 'o', 'g', ' ', ' ', ' ', ' ', ' ', ' '};


        int length = 6;


        tst.replaseSpaces(ch, length);  


    }


}

Report Error

View answer Workspace Report Error Discuss

0 2188
Q:

What is the difference between a constructor and a method?

Answer

A constructor is a member function of a class that is used to create objects of that class. It has the same name as the class itself, has no return type, and is invoked using the new operator. We cannot invoke a constructor directly.


 


A method is an ordinary member function of a class. It has its own name, a return type (which may be void), and is invoked using the dot operator.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 2188
Q:

The principle of diversification tells us that

A) spreading an investment across many diverse assets will eliminate some of the total risk B) concentrating an investment in two or three large stocks will eliminate all of the unsystematic risk
C) spreading an investment across five diverse companies will not lower the total risk D) concentrating an investment in three companies all within the same industry will greatly reduce the systematic risk
 
Answer & Explanation Answer: A) spreading an investment across many diverse assets will eliminate some of the total risk

Explanation:

The principle of diversification tells us that spreading an investment across many diverse assets will eliminate some of the total risk.

Report Error

View Answer Report Error Discuss

Filed Under: Accounts Receivable
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

0 2187