Pre-screening Test - By Engrip

40 Questions | Total Attempts: 362

SettingsSettingsSettings
Pre-screening Test - By Engrip

Instructions This technical test covers basics of Java, C, RDBMS, HTML and CSS Test contains 40 questions and duration for the test is 30 minutes Each question will have only one correct answer. Every right answer will carry 1 point. Negative Marking: Wrong answer will carry -0. 25 points. Decision of the EnGrip is final and binding. All the best!


Questions and Answers
  • 1. 
    What is the base class for all Exception ?
    • A. 

      Java.lang.Exception

    • B. 

      Java.lang.Throwable

    • C. 

      Java.lang.Error

    • D. 

      Java.lang.RuntimeException

  • 2. 
    With x = 0, which of the following are legal lines of Java code for changing the value of x to 1?
    1. x++
    2. x=x+1
    3. x+=1
    4. x=+1
    • A. 

      1, 2 & 3

    • B. 

      1 & 4

    • C. 

      1, 2, 3 & 4

    • D. 

      2 & 3

  • 3. 
    Which of these operators can be used to concatenate two or more String objects in Java?
    • A. 

      +

    • B. 

      +=

    • C. 

      |

    • D. 

      &

  • 4. 
    What will be the output of the program? class PassA  {     public static void main(String [] args)      {         PassA p = new PassA();         p.start();     }     void start()      {         long [] a1 = {3,4,5};         long [] a2 = fix(a1);         System.out.print(a1[0] + a1[1] + a1[2] + " ");         System.out.println(a2[0] + a2[1] + a2[2]);     }     long [] fix(long [] a3)      {         a3[1] = 7;         return a3;     } }
    • A. 

      12 15

    • B. 

      15 15

    • C. 

      3 4 5 3 7 5

    • D. 

      3 7 5 3 7 5

  • 5. 
    What will be the output of the program? class Equals  {     public static void main(String [] args)      {         int x = 100;         double y = 100.1;         boolean b = (x = y);          System.out.println(b);     } }
    • A. 

      True

    • B. 

      False

    • C. 

      Compilation error

    • D. 

      Run time exception

  • 6. 
    Public void foo( boolean a, boolean b) {      if( a )      {         System.out.println("A");      }      else if(a && b)     {          System.out.println( "A && B");      }      else      {          if ( !b )          {             System.out.println( "notB") ;         }          else          {             System.out.println( "ELSE" ) ;          }      }  }
    • A. 

      If a is true and b is true then the output is "A && B"

    • B. 

      If a is true and b is false then the output is "notB"

    • C. 

      If a is false and b is true then the output is "ELSE"

    • D. 

      If a is false and b is false then the output is "ELSE"

  • 7. 
    Switch(x)  {      default:           System.out.println("Hello");  } Which two are acceptable types for x in Java? 1. byte 2. long 3. char 4. float 5. Short 6. Long
    • A. 

      1 and 3

    • B. 

      3 and 5

    • C. 

      2 and 4

    • D. 

      4 and 6

  • 8. 
    What will be the output of the program? public class Foo  {       public static void main(String[] args)      {         try          {              return;          }          finally          {             System.out.println( "Finally" );          }      }  }
    • A. 

      Finally

    • B. 

      Compilation fails

    • C. 

      Run time exception

    • D. 

      Code runs with no out put

  • 9. 
    You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?
    • A. 

      Public

    • B. 

      Private

    • C. 

      Protected

    • D. 

      Transient

  • 10. 
    What will be the output of the program? public class Test  {     public static int y;     public static void foo(int x)      {         System.out.print("foo ");         y = x;     }     public static int bar(int z)      {         System.out.print("bar ");         return y = z;     }     public static void main(String [] args )      {         int t = 0;         assert t > 0 : bar(7);         assert t > 1 : foo(8); /* Line 18 */         System.out.println("done ");     } }
    • A. 

      Bar

    • B. 

      Bar done

    • C. 

      Foo done

    • D. 

      Compilation fails

  • 11. 
    Suppose that in a C program snippet, followings statements are used. i) sizeof(int); ii) sizeof(int*); iii) sizeof(int**);
    • A. 

      I), ii) and iii) would compile successfully and size of each would be same i.e. 4

    • B. 

      I), ii) and iii) would compile successfully but the size of each would be different and would be decided at run time.

    • C. 

      I), ii) and iii) would compile successfully but the size of each would be different and would be decided at run time.

    • D. 

      I), ii) and iii) would compile successfully but the size of each would be different and would be decided at run time.

  • 12. 
    Let x be an integer which can take a value of 0 or 1. The statement if(x = =0) x = 1; else x = 0; is equivalent to which one of the following in a C program?
    • A. 

      X=1—x;

    • B. 

      X=x—1;

    • C. 

      X=1+x;

    • D. 

      X=1%x;

  • 13. 
    For 16-bit compiler allowable range for integer constants is ________?
    • A. 

      -3.4e38 to 3.4e38 

    • B. 

      -32767 to 32768

    • C. 

      -32668 to 32667

    • D. 

      -32768 to 32767

  • 14. 
    What would be the output of the following C snippet: short testarray[4][3] = { {1}, {2,3}, {4,5,6}}; printf("%d", sizeof(testarray));
    • A. 

      12

    • B. 

      7

    • C. 

      Compiler error

    • D. 

      24

  • 15. 
    In the context of "break" and "continue" statements in C, pick the best statement.
    • A. 

      “break” can be used in “for”, “while” and “do-while” loop body. “break” and “continue” can be used in “for”,

    • B. 

      “break” and “continue” can be used in “for”, “while” and “do-while” loop body. But only “break” can be used in “switch” body

    • C. 

      “continue” can be used in “for”, “while” and “do-while” loop body. break” and “continue” can be used in “for”

    • D. 

      “continue” can be used in “for”, “while” and “do-while” loop body. break” and “continue” can be used in “for”

  • 16. 
    Void swap (int *x, int *y) {     static int *temp;     temp = x;     x = y;     y = temp; } void printab () {     static int i, a = -3, b = -6;     i = 0;     while (i <= 4)     {         if ((i++)%2 == 1) continue;         a = a + i;         b = b + i;     }     swap (&a, &b);     printf("a =  %d, b = %d\n", a, b); } main() {     printab();     printab(); } 
    • A. 

      A = 0, b = 3 a = 0, b = 3

    • B. 

      A = 3, b = 0 a = 12, b = 9

    • C. 

      A = 6, b = 3 a = 15, b = 12

    • D. 

      A = 6, b = 3 a = 15, b = 12

  • 17. 
    What’s going to happen when we compile and run the following C program snippet? #include <stdio.h> int main() {  int a = 10;  int b = 15;    printf("%d",(a+1),(b=a+2));  printf(" %d",b);    return 0; }  
    • A. 

      11 15

    • B. 

      11 12

    • C. 

      Compilation error

    • D. 

      None of the above

  • 18. 
    As per C language standard, which of the followings is/are not keyword(s)? auto make mainsizeof elseif Pick the best statement.
    • A. 

      Make main elseif

    • B. 

      Make main

    • C. 

      Auto man

    • D. 

      Size of make

  • 19. 
    What will be the output of the following C program: int incr (int i) {    static int count = 0;    count = count + i;    return (count); } main () {    int i,j;    for (i = 0; i <=4; i++)       j = incr(i); }
    • A. 

      10

    • B. 

      4

    • C. 

      6

    • D. 

      7

  • 20. 
    The following C declarations struct node  {     int i;     float j;  };  struct node *s[10] ;  define s to be: 
    • A. 

      An array, each element of which is a pointer to a structure of type node

    • B. 

      A structure of 3 fields: an integer, a float, and an array of 10 elements

    • C. 

      An array, each element of which is a structure of type node.

    • D. 

      A structure of 2 fields, each field being a pointer to an array of 10 elements

  • 21. 
    To add a new column in an existing relation use
    • A. 

      Create table

    • B. 

      Alter table

    • C. 

      Modify table

    • D. 

      Truncate table

  • 22. 
    Which of the following is not a integrity constraint ?
    • A. 

      Not null

    • B. 

      Positive

    • C. 

      Unique

    • D. 

      Check predicate

  • 23. 
    A table on the many side of a one to many or many to many relationship must:
    • A. 

      Be in Second Normal Form (2NF)

    • B. 

      Be in Third Normal Form (3NF)

    • C. 

      Have a single attribute

    • D. 

      Have a composite

  • 24. 
     Which forms simplifies and ensures that there is minimal data aggregates and repetitive groups?
    • A. 

      1NF

    • B. 

      2NF

    • C. 

      3NF

    • D. 

      ALL OF THESE

  • 25. 
    Which of the join operations do not preserve non matched tuples?
    • A. 

      Left outer join

    • B. 

      Right outer join

    • C. 

      Inner join

    • D. 

      None