• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE-CS-2015 (Mock Test)

Question 11

Consider the following three table to store student enrollements in different courses.

Student(EnrollNo, Name)
Course(CourseID, Name)
EnrollMents(EnrollNo, CourseID) 

What does the following query do?

SELECT S.Name
FROM Student S, Course C, Enrollments E
WHERE S.EnrollNo = E.EnrollNo AND 
      C.Name = "DBMS" AND
      E.CourseID = C.CourseID AND
      S.EnrollNo IN 
        (SELECT S2.EnrollNo
         FROM Student S2, Course C2, Enrollments E2
         WHERE S2.EnrollNo = E2.EnrollNo AND
               E2.CourseID = C2.CourseID
               C2.Name = "OS")
  • Name of all students who are either enrolled in "DBMS" or "OS" courses

  • Name of all students who are enrolled in "DBMS" and "OS"

  • Name of all students who are either enrolled in "DBMS" or "OS" or both.

  • None of the above

Question 12

Consider the following Employee table 
 

ID   salary   DeptName
1    10000      EC
2    40000      EC
3    30000      CS
4    40000      ME
5    50000      ME
6    60000      ME 
7    70000      CS 


How many rows are there in the result of following query? 
 

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


 

  • 6
     

  • 5
     

  • 4
     

  • 0
     

Question 13

Consider the situation in which the disk read/write head is currently located at track 45 (of tracks 0-255) and moving in the positive direction. Assume that the following track requests have been made in this order: 40, 67, 11, 240, 87. What is the order in which optimised C-SCAN would service these requests and what is the total seek distance?
  • 600
  • 810
  • 505
  • 550

Question 14

Consider the following Deterministic Finite Automata Automata Which of the following is true?
  • It only accepts strings with prefix as "aababb"
  • It only accepts strings with substring as "aababb"
  • It only accepts strings with suffix as "aababb"
  • None of the above

Question 15

How many minimum states are required in a DFA to find whether a given binary string has odd number of 0\'s or not, there can be any number of 1\'s.
  • 1
  • 2
  • 3
  • 4

Question 16

Which of the following is FALSE about SJF (Shortest Job First Scheduling)?
S1: It causes minimum average waiting time
S2: It can cause starvation
  • Only S1
  • Only S2
  • Both S1 and S2
  • Neither S1 nor S2

Question 17

Given an array that represents elements of arithmetic progression in order. It is also given that one element is missing in the progression, the worst case time complexity to find the missing element efficiently is:
  • Θ(n)
  • Θ(nLogn)
  • Θ(Logn)
  • Θ(1)

Question 18

Consider the following two problems of graph. 1) Given a graph, find if the graph has a cycle that visits every vertex exactly once except the first visited vertex which must be visited again to complete the cycle. 2) Given a graph, find if the graph has a cycle that visits every edge exactly once. Which of the following is true about above two problems.
  • Problem 1 belongs NP Complete set and 2 belongs to P
  • Problem 1 belongs to P set and 2 belongs to NP Complete set
  • Both problems belong to P set
  • Both problems belong to NP complete set

There are 18 questions to complete.

Last Updated :
Take a part in the ongoing discussion