Friday, August 26, 2011

SOME BASIC APTITUDE FORMULAS






Question 1

Can you give a simple formula to find average of sum of squares of first n natural numbers ?

Answer 1

(n+1)(2n+1)/6 can be used to calculate the average of sum of first n natural numbers.

Question 2

Given log x(ab) and log x(a/b) , how you will find log xa

Answer 2

log x(ab) can be written as log x(a) + log x(b) .... equation 1. log x(a/b) can be written as log x(a) - log x(b) ... equation 2.

Solving equation 1 and 2 we will get log x(a) = (log x(ab) + log x(a/b) / 2)

Question 3

Consider a rhombus with diagonals of lengths d1 and d2. What could be its area ?

Answer 3

Area of the rhombus = 1/2(d1 X d2)

Question 4

Quick Answer Required ; Can you quickly tell the ratio of the volume of a cylinder of height h to that of another cylinder of unit height but with same radius.

Answer 4

Height h is the answer. Reason. Volume V1 of cylinder of height h and radius r, V1 = ∏r2h Volume V2 of another cylinder of unit height of same radius r, V2 = ∏r2 (by substituting 1 for h) Now answer is, V1/V2 = h

QUERY BASED QUESTIONS


Interview Question 1

Can you quickly suggest a SQL query that can remove duplicate rows from a table ?

Answer 1

Delete from table a where rowid > ( select min(rowid) from table b where a.key = b.key)
(You can think of more ways to do the same task.)

Interview Question 2

Can a sql query employing group by clause have aggregate functions on the return set ?

Answer 2

Yes, it is definitely possible. Only thing to remember is that the return set may not have columns other than those based on which group by is being performed.

Interview Question 3

In context of SQL results, what is called a phantom read ? How this could happen ?

Answer 3

When two identical select queries are being executed, the first one and second one giving out different sets of results is called phantom read.
This happens when SELECT query does not acquire appropriate locks which literally allows insert queries to modify the rows in between the two identical select queries.

Interview Question 4

Name any four database objects on which GRANT statement can be applied ?

Answer 4

Objects on which GRANT statement can be applied include tables, views, stored procedures & sequences

No comments:

Post a Comment