Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

An ISP has a link of 100Mbps which is shared by its subscribers. Considering the fact that all of its subscribers are active 50% of the time and the probabilities of being active are independent, the ISP has promised 25 Mbps to its 6 subscribers. What is the probability that any subscriber gets degraded service (less than promised speed).(A) 1/32(B) 5/16(C) 1/2(D) 7/64

Answer»
2.

Consider a 3 game tournament between two teams. Assume that every game results in either a win or loss. The team that wins two or more games wins the series. The probability for wining the first game for both teams is 1/2. The probability for a team to win a game after a win is 2/3. The probability of wining a game after a loss is 1/3. Note that the effect of only previous game is considered. What is the probability for a team to win the series after loosing first game.(A) 1/9(B) 1/6(C) 2/9(D) 1/3

Answer» Answer: (C)
Explanation:

A team has 3 chances(games) to win tournament.
To win the tournament, a team must win atleast 2 games. Acc to question,
Team looses first chances. Now, to win, it is must to win left 2 games.
Probability to win the 2nd game : 1/3 (as previous game was a loss)
Probability to win the 3rd game : 2/3 (as previous game was a win)
So, Probability to win the tournament = 1/3 * 2/3

= 2/9

3.

Consider the following Employee tableID salary DeptName1 10000 EC2 40000 EC3 30000 CS4 40000 ME5 50000 ME6 60000 ME 7 70000 CS How many rows are there in the result of following query?SELECT E.IDFROM Employee EWHERE EXISTS (SELECT E2.salary FROM Employee E2 WHERE E2.DeptName = 'CS' AND E.salary > E2.salary)(A) 0(B) 4(C) 5(D) 6

Answer» Answer: (C)
Explanation: Background:

  1. WHERE EXISTS tests for the existence of any records in a subquery.
  2. EXISTS returns true if the subquery returns one or more records.
  3. EXISTS is commonly used with correlated subqueries.

Here in the above question, there is a correlated subquery because the subquery references the enclosing query (relation Employee renamed as E)
The subquery (SELECT E2.salary FROM Employee E2
WHERE E2.DeptName = ‘CS’)
Filters out E2 relation as (all tuples where DeptName is CS and the respective salaries)

Now the correlated query works as follows:

SELECT E.ID
FROM Employee E
WHERE EXISTS (SELECT E2.salary
FROM Employee E2
WHERE E2.DeptName = ‘CS’
AND E.salary > E2.salary)

It takes one tuple from the Employee Relation and displays its ID if the WHERE EXISTS returns true i.e. the subquery returns one or more records. This happens in the case when the tuple from the Employee Relation E has the value of the salary attribute greater than any one of the values of the salary attribute filtered out above.
So tuples filtered out would be all the tuples that have their salary attribute value greater than the salary values of at least one from the E2 relation (3000 and 7000).

ID salary DeptName
2 40000 EC
4 40000 ME
5 50000 ME
6 60000 ME
7 70000 CS

Finally it displays their ID’s and the output would be:
2
4
5
6
7

Hence option (C) 5 rows.