0% found this document useful (0 votes)
7 views

Sample Questions Upload

Uploaded by

Global Institute
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Sample Questions Upload

Uploaded by

Global Institute
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Question Type Question Option1 Option2

Database Management Data Business


MCQ What does DBMS stand for?
System Management System

Which of the following is a


MCQ Name Address
primary key?

Which SQL command is used to


MCQ INSERT SELECT
retrieve data?

Which of the following is a DDL


MCQ SELECT UPDATE
command?

A field in a table that


MCQ What is a foreign key? A unique identifier is primary key in
another table

Which normal form removes


MCQ First Normal Form Second Normal Form
partial dependencies?

MCQ What is a tuple in DBMS? A row in a table A column in a table

Which SQL clause is used to filter


MCQ SELECT WHERE
records?

Which command is used to


MCQ DELETE DROP
remove a table from a database?

What does ACID stand for in Automatic Consistency Atom Consistency


MCQ
DBMS? Integrity Durability Isolation Duration

Which of the following is a non-


MCQ MySQL Oracle
relational database?

MCQ What is the use of the GROUP BY To group identical data To select data
clause?

Which of the following is an


MCQ SELECT CREATE
example of a DML command?

MCQ What is a view in DBMS? A virtual table A real table

Which SQL command is used to


MCQ INSERT UPDATE
modify data?

What is the purpose of a JOIN in To combine records


MCQ To delete records
SQL? from two tables
Which type of JOIN returns all
MCQ records when there is a match in INNER JOIN LEFT JOIN
either table?

A way to quickly
MCQ What is an index in DBMS? A copy of a table
locate data

Which SQL keyword is used to


MCQ WHERE ORDER BY
sort the result-set?

A stored procedure
MCQ What is a trigger in DBMS? A function that automatically
executes

A key that consists of two or


MCQ What is a composite key? A unique key
more attributes

Which constraint ensures that a


MCQ column cannot have a NULL UNIQUE PRIMARY KEY
value?

What is the purpose of the


MCQ To filter data after grouping To join tables
HAVING clause?

Which normal form is based on


MCQ the concept of multi-valued First Normal Form Second Normal Form
dependencies?

What does BCNF stand for in Binary-Coded Normal


MCQ Boyce-Codd Normal Form
DBMS? Form

Which SQL statement is used to


remove all rows from a table
MCQ DELETE TRUNCATE
without logging individual row
deletions?
What is the correct syntax to
MCQ #include <header> include <header>
include a header file in C?

Which of the following is a valid


MCQ 1variable variable_1
variable name in C?

MCQ What does printf function do in Reads input Prints output


C?
Which of the following data types
MCQ int char
can hold a decimal value?

MCQ What is the purpose of the return To exit a loop To exit a function
statement in C?

How do you declare a constant in


MCQ const int a; constant int a;
C?

MCQ What is the size of an int in C on 1 byte 2 bytes


most platforms?
Which of the following is used to
MCQ /* comment */ // comment
comment a single line in C?

What is the output of


MCQ 10 20
printf("%d", 10 + 20);?

Which operator is used to access


MCQ -> .
a member of a structure in C?

What does the sizeof operator Returns the size of a Returns the size of a
MCQ
do? variable data type
Which function is used to read a
MCQ gets() scanf()
string in C?
Which loop is guaranteed to
MCQ for loop while loop
execute at least once?
How can you declare an array of
MCQ int arr[10]; int arr(10);
10 integers in C?
Which of the following
They store memory They cannot be
MCQ statements is true about
addresses dereferenced
pointers?
What will be the output of
MCQ A B
printf("%c", 'A' + 1);?
Which of the following is a logical
MCQ + -
operator in C?

How do you define a function in


MCQ void function_name() function_name() void
C?

What is the correct way to


MCQ allocate memory dynamically in malloc() calloc()
C?
What will be the output of
MCQ 3 3.33
printf("%d", 10 / 3);?
Which of the following is not a
MCQ auto register
valid storage class in C?
What will happen if you divide a The output will be
MCQ The program will crash
number by zero in C? zero

Which header file is required for


MCQ stdlib.h string.h
using printf and scanf?

MCQ What is the purpose of the break To exit a loop To skip an iteration
statement?

What is the output of


MCQ 20 14
printf("%d", 2 + 3 * 4);?

Which function is used to


MCQ strcat() strjoin()
concatenate two strings in C?

Which of the following is a


MCQ #include #define
preprocessor directive?

What will be the output of


MCQ 1 2
printf("%d", sizeof(char));?
How can you find the length of a
MCQ length() strlength()
string in C?
Which of the following is the
MCQ correct way to declare a variable int a; int a = 5;
in Java?

What is the default value of a


MCQ 1 0
boolean variable in Java?

Which of the following is not a


MCQ int float
primitive data type in Java?
How do you create an array in
MCQ int arr[] = new int[10]; int arr = new int[10];
Java?

MCQ What is the purpose of the static To create instance variables To create class
keyword in Java? variables

Which method is used to start the


MCQ main() start()
execution of a Java program?

What will be the output of


MCQ System.out.println(10 + 20 + 30Hello Hello30
"Hello");?
Which of the following is used to
MCQ try-catch throw
handle exceptions in Java?

MCQ What is the size of an int in Java? 2 bytes 4 bytes

Which keyword is used to inherit


MCQ extends implements
a class in Java?

What is the default value of an


MCQ 0 null
instance variable in Java?

Which of the following is not a


MCQ for foreach
valid loop in Java?

MCQ What does the final keyword do Prevents method overriding Prevents inheritance
in Java?

Which operator is used to


MCQ = ==
compare two values in Java?
What is the output of
MCQ System.out.println(5 > 3 && 2 1 0
< 4);?
How do you declare an interface
MCQ interface MyInterface {} MyInterface {}
in Java?
What will be the output of
MCQ System.out.println("Java".char J a
At(2));?

What is the purpose of the this To refer to the


MCQ To refer to the current class
keyword in Java? superclass
How can you convert a string to
MCQ Integer.parseInt("123") (int)"123"
an integer in Java?

Which of the following is not a


MCQ part of the Java Collections List Map
Framework?

How do you create an instance of ClassName obj = new


MCQ new ClassName();
a class in Java? ClassName();

MCQ What is the purpose of the super To call a superclass method To call a constructor
keyword in Java?

Which of the following is an


MCQ private protected
access modifier in Java?
What is the output of
MCQ 3 1
System.out.println(10 % 3);?
How can you declare a constant
MCQ final int a = 10; const int a = 10;
in Java?

MCQ What does Thread.sleep(1000); Pauses execution for 1000 Creates a new thread
do in Java? milliseconds

Which of the following can be a


MCQ Abstract class Interface
superclass in Java?

What is the output of


MCQ System.out.println("10" + 30 1020
20);?

Which of the following is used to


MCQ extends Thread implements Runnable
create a thread in Java?

What will happen if you try to


The program will compile A runtime error will
MCQ access an array index that is out
successfully occur
of bounds in Java?

How do you comment a single


MCQ // comment /* comment */
line in Java?
What is the default value of a
MCQ 0 0
float variable in Java?

How do you define a method in returnType methodName() methodName()


MCQ
Java? {} returnType {}

What is the output of


MCQ System.out.println("abc".toUp ABC abc
perCase());?
Which of the following is the
methodName void()
MCQ correct syntax to create a method void methodName() {}
{}
in Java?

Which exception is thrown when


MCQ ArithmeticException NullPointerException
dividing by zero in Java?
How do you convert a string to
MCQ string.toUpperCase() String.toUpperCase()
uppercase in Java?

Which method is called when an


MCQ init constructor
object is created in Java?

What is the output of


MCQ System.out.println(10 + " is a 10 is a number. 10is a number.
number.");?
Which of the following keywords
MCQ is used to prevent method final static
overriding?

How do you declare a multi-


MCQ int[][] arr; int arr[][];
dimensional array in Java?

What is the return type of the


MCQ void int
main method in Java?

Which class is the superclass of all


MCQ Object Class
classes in Java?

MCQ What does the break statement Exits the loop Exits the method
do in Java?

How do you import a package in import


MCQ import packageName;
Java? packageName.*;

What is the purpose of the To restrict access to a


MCQ To make a variable constant
volatile keyword in Java? variable

How do you declare a constructor


MCQ ClassName() {} void ClassName() {}
in Java?

What is the default value of an


MCQ 0 null
object reference in Java?

How can you check if an object is obj.isInstance(ClassNa


MCQ obj instanceof ClassName
an instance of a class in Java? me)

Which of the following is not a


MCQ Encapsulation Inheritance
feature of OOP?

How do you declare a package in packageName


MCQ package packageName;
Java? package;
Option3 Option4 Option5 Correct Answer Default Marks
Database
Data Basic Management Database Major
None Management 1
System System
System

Social Security
Social Security Number Age Gender 1
Number

DELETE UPDATE DROP SELECT 1

DELETE CREATE INSERT CREATE 1

A field in a table
that is primary
An index A null value A composite key 1
key in another
table

Second Normal
Third Normal Form BCNF Fifth Normal Form 1
Form

A key in a table A relation A primary key A row in a table 1

FROM INSERT ORDER BY WHERE 1

REMOVE TRUNCATE ALTER DROP 1

Atomicity
Atomic
Atomicity Consistency Atomicity Common Consistency
Consistency 1
Isolation Durability Integrity Data Isolation
Index Durability
Durability

MongoDB SQL Server SQLite MongoDB 1

To group
To delete data To create data To update data 1
identical data

INSERT ALTER DROP INSERT 1

A duplicate
A copy of another table A table of indexes A virtual table 1
record

DELETE CREATE SELECT UPDATE 1

To combine
To select
To update records To insert records records from two 1
records
tables
FULL OUTER
RIGHT JOIN CROSS JOIN FULL OUTER JOIN 1
JOIN

A way to quickly
A view A trigger A function 1
locate data

GROUP BY HAVING LIMIT ORDER BY 1

A stored
procedure that
A type of JOIN A type of key A primary key 1
automatically
executes

A key that
A primary key A foreign key An index consists of two or 1
more attributes

FOREIGN KEY NOT NULL CHECK NOT NULL 1

To filter data
To delete rows To sort data To update data 1
after grouping

Fourth Normal Fourth Normal


Third Normal Form BCNF 1
Form Form

Binary-Code Basic-Codd Normal Boyce-Codd


Boyce-Codd Nested Form 1
Normal Form Form Normal Form

DROP REMOVE CLEAN TRUNCATE 1

#header #include
#include header #import <header> 1
<header> <header>

variable-1 variable.1 _variable variable_1 1

Declares a
Returns a value None Prints output 1
variable

float bool void float 1

To declare a variable To print output To read input To exit a function 1

int const a; #define a Both 1 and 3 Both 1 and 3 1

4 bytes 8 bytes Varies 4 bytes 1


# comment -- comment // comment // comment 1

30 1020 Error 30 1

& * :: . 1

Deallocates
Allocates memory Both 1 and 2 Both 1 and 2 1
memory

printf() puts() read() gets() 1

do-while loop infinite loop foreach loop do-while loop 1

int arr = new


int arr{10}; int arr:10; int arr[10]; 1
int[10];
They store
They cannot be
They are always integers None of the above memory 1
used in arrays
addresses

C 66 Error B 1

= &

def
func void
function_name(void) function_name( 1
function_name() function_name()
)

realloc() free() All of the above All of the above 1

3 3 3 3 1

extern static dynamic dynamic 1

The output will be The output will The output will


None of the above 1
undefined be one be undefined

stdio.h conio.h math.h stdio.h 1

To continue to the next To stop a


To exit a function To exit a loop 1
loop program

10 12 15 14 1

append() concat() strappend() strcat() 1

#if #ifdef All of the above All of the above 1

4 8 16 1 1
strlen() size() count() strlen() 1

a int = 5; Both 1 and 2 None of the above Both 1 and 2 1

0 null None 0 1

String boolean char String 1

int arr[] = new


int arr[10]; Both 1 and 2 None of the above 1
int[10];

To define methods that


Both 2 and 3 None of the above Both 2 and 3 1
belong to the class

run() execute() begin() main() 1

10Hello20 10 + 20 + Hello Hello10 30Hello 1

finally All of the above None of the above All of the above 1

8 bytes Varies None of the above 4 bytes 1

inherits derives None of the above extends 1

Depends on the Depends on the


0 None of the above 1
type type

while until None of the above until 1

Makes a variable constant All of the above None of the above All of the above 1

=== := -> == 1

1 0 Error 1 1

interface
class MyInterface {} All of the above None of the above 1
MyInterface {}

v Error None of the above v 1

To refer to a To refer to the


To refer to a static variable None of the above 1
local variable current class
Integer.toInteg Integer.parseInt(
String.toInt("123") None of the above 1
er("123") "123")

Set Array None of the above Array 1

ClassName obj =
ClassName obj; Both 1 and 2 None of the above new 1
ClassName();

To refer to instance
All of the above None of the above All of the above 1
variables

public All of the above None of the above All of the above 1

0 10 2 1 1

int a = 10; final int a; Both 1 and 3 final int a = 10; 1

Pauses execution
Waits for user
Ends the program None of the above for 1000 1
input
milliseconds

Concrete class All of the above None of the above All of the above 1

10 20 Error 1020 1

None of the
Both 1 and 2 Both 1 and 2 Both 1 and 2 1
above

The array will A runtime error


The program will exit None of the above 1
be resized will occur

<!-- comment --> # comment None of the above // comment 1

null NaN None of the above 0 1

None of the returnType returnType


def methodName() {} 1
above methodName() {}; methodName() {}

Abc Error None of the above ABC 1

void void
methodName() void {} None of the above 1
methodName {} methodName() {}

ArrayIndexOutOfBoundsExc ClassCastExcept ArithmeticExcept


None of the above 1
eption ion ion
str.toUpperCas str.toUpperCase(
str.toUpperCase() None of the above 1
e() )

new create None of the above constructor 1

None of the
Error 10 is a number 10 is a number. 1
above

private protected None of the above final 1

None of the
Both 1 and 2 Both 1 and 2 Both 1 and 2 1
above

None of the
String Both 1 and 3 void 1
above

None of the
Base All classes Object 1
above
Stops the
Continues the loop None of the above Exits the loop 1
program

None of the
Both 1 and 2 Both 1 and 2 Both 1 and 2 1
above

To indicate that a
To indicate that a variable None of the variable may
All of the above 1
may change unexpectedly above change
unexpectedly

ClassName {} ClassName() None of the above ClassName() {} 1

Depends on the
0 None of the above null 1
type

None of the obj instanceof


obj.check(ClassName) Both 1 and 2 1
above ClassName

Polymorphism Compilation None of the above Compilation 1

None of the package package


package packageName{}; 1
above packageName; packageName;
Default Time To Solve Difficulty Level Hint Solution

Think about DBMS stands for Database


1 Easy
managing data Management System.

The primary key is a unique


Think unique
1 Easy identifier for each record in a
identifier
table.

Retrieve means The SELECT command is used


1 Easy to retrieve data from a
to select data
database.
DDL stands for CREATE is a DDL command
1 Medium Data Definition used to define database
Language structure.
A foreign key creates a link
Connects two between tables by referencing
1 Medium
tables the primary key in another
table.

Check between
2NF removes partial
1 Medium first and second
dependencies from a relation.
form
Row is another Tuple refers to a row or record
1 Easy
name in a table.
The WHERE clause is used to
1 Medium Focus on filtering filter records based on a
condition.
Focus on The DROP command removes a
1 Easy structure table and its data from the
deletion database.

ACID stands for Atomicity,


It's a property of
1 Hard Consistency, Isolation, and
transactions
Durability.

MongoDB is a non-relational
1 Medium Focus on NoSQL
NoSQL database.
GROUP BY is used to group
Think
1 Medium rows that have the same values
aggregation
in specified columns.
DML stands for
Data INSERT is a DML command
1 Easy
Manipulation used to add new data to a table.
Language
Not a physical A view is a virtual table based on
1 Medium
table the result of a query.

Think The UPDATE command is used


1 Easy to modify existing data in a
modification
table.

Focus on JOIN is used to combine records


1 Medium
combining tables from two or more tables.
Focus on FULL OUTER JOIN returns all
1 Hard returning all records when there is a match in
matches either table.
Think of An index is used to improve the
1 Medium speeding up speed of data retrieval
searches operations.

1 Easy Focus on sorting The ORDER BY keyword is used


to sort the result-set.

A trigger is a stored procedure


It's an automatic
1 Medium that automatically runs when
response
certain events occur.

A composite key consists of two


More than one
1 Medium or more attributes that together
attribute
uniquely identify a record.

Prevents null The NOT NULL constraint


1 Easy ensures that a column cannot
values
have a NULL value.

HAVING is used to filter records


1 Medium After grouping
after the GROUP BY clause.

Focus on 4NF deals with multi-valued


1 Hard
dependencies dependencies.

BCNF stands for Boyce-Codd


Think of
1 Hard Normal Form, an advanced
normalization
version of 3NF.

TRUNCATE removes all rows


Fast way to
1 Medium
remove all rows without logging individual row
deletions.

Think about The correct syntax is #include


1 Easy
libraries <header>.

Starts with letter Variable names can start with a


1 Easy
or underscore letter or underscore.

Think about The printf function is used to


1 Easy
displaying print output to the console.
Think about The float data type can hold
1 Easy
precision decimal values.
Think about The return statement exits a
1 Easy function function and optionally returns a
outcomes value.

Think of You can declare a constant using


1 Medium
immutability const int a; or int const a;.

Think about On most platforms, the size of


1 Medium
standard sizes an int is typically 4 bytes.
Think of Single-line comments are made
1 Easy commenting
style using // comment.

Think about
1 Easy The output is 30.
arithmetic

Think of The . operator is used to access


1 Medium
structures members of a structure.

1 Medium Think of sizes The sizeof operator returns the


size of a variable or data type.
Think about The gets() function is used to
1 Easy
input read a string.
Think about The do-while loop guarantees
1 Medium
execution at least one execution.
Think of An array of 10 integers can be
1 Easy
collections declared as int arr[10];.

Think about Pointers store memory


1 Medium
memory addresses of variables.

Think of ASCII The output will be B (ASCII value


1 Medium
values of 'A' is 65).

1 1

Think about A function is defined using void


1 Easy
syntax function_name().

Think about malloc(), calloc(), and


1 Medium memory realloc() are used for dynamic
management memory allocation.
Think of integer The output will be 3 due to
1 Easy
division integer division.
Think about dynamic is not a valid storage
1 Medium
storage class in C.
Think of error Dividing by zero will result in
1 Hard
handling undefined behavior.

Think of The stdio.h header file is


1 Easy required for input and output
input/output
functions.

Think of flow The break statement is used to


1 Easy
control exit a loop or switch statement.

Think about
1 Medium operator The output will be 14 due to
precedence operator precedence.

Think about The strcat() function is used to


1 Easy
combining concatenate two strings.
Preprocessor directives include
Think about
1 Easy #include, #define, #if, and
compilation
#ifdef.

1 Easy Think about size The size of char is typically 1


byte.
Think of string
1 Easy The strlen() function is
handling
Think about
1 Easy variable Both int a; and int a = 5; are
initialization correct declarations.

Think of boolean The default value of a boolean


1 Easy
initialization variable is false.

Think about data String is not a primitive data


1 Easy
types type; it is an object.
Think about An array is created using int
1 Easy
array creation arr[] = new int[10];.

Think about class The static keyword defines


1 Medium class-level variables and
members
methods.

Think of program The main() method is the entry


1 Easy
entry point point of a Java program.

Think about
1 Easy string The output will be 30Hello.
concatenation
Think about error try, catch, and finally are used
1 Medium
handling for exception handling.
Think about data The size of an int in Java is
1 Easy
types always 4 bytes.
Think about The extends keyword is used to
1 Medium
inheritance inherit a class.
Think about
The default value depends on
1 Medium instance
the type of the variable.
variables
Think about
until is not a valid loop
1 Medium control
structures construct in Java.

Think about The final keyword prevents


1 Medium method overriding, inheritance,
immutability
and makes variables constant.
Think about The == operator is used to
1 Easy
comparison compare two values.

Think about
1 Easy The output will be true.
boolean logic

Think about An interface is declared using


1 Medium
interfaces interface MyInterface {}.

Think about The output will be v, as indexing


1 Easy
string indexing starts at 0.

Think about
1 Medium object The this keyword refers to the
orientation current instance of the class.
You can use
Think about type
1 Medium Integer.parseInt("123") to
conversion
convert a string to an integer.
Array is not a part of the
Think about
1 Medium Collections Framework; it is a
collections
basic data structure.
Think about An instance of a class is created
1 Easy object using ClassName obj = new
instantiation ClassName();.

Think about The super keyword is used to


1 Medium call superclass methods and
inheritance
constructors.
Think about Access modifiers include
1 Easy
visibility private, protected, and public.
Think about The output will be 1 (10 divided
1 Easy
modulus by 3 gives remainder 1).
Think about A constant is declared using
1 Easy
immutability final int a = 10;.

Thread.sleep(1000); pauses
Think about
1 Medium the current thread for 1000
threading
milliseconds.

Any class, including abstract


Think about class
1 Medium classes and interfaces, can be a
hierarchy
superclass.
Think about
1 Easy string The output will be 1020 due to
concatenation string concatenation.

A thread can be created by


Think about
1 Medium extending Thread or
threading
implementing Runnable.
Accessing an out-of-bounds
Think about error index causes a
1 Medium
handling ArrayIndexOutOfBoundsExce
ption.
Think about Single-line comments are made
1 Easy
commenting using // comment.
Think about The default value of a float
1 Medium
default values variable is 0.0.
A method is defined using
Think about
1 Medium returnType methodName()
method syntax
{}.
Think about
1 Easy string The output will be ABC.
manipulation
Think about
The correct syntax is void
1 Medium method
definition methodName() {}.

Think about ArithmeticException is thrown


1 Medium
arithmetic errors when dividing by zero.
Think about You can use str.toUpperCase()
1 Easy
string methods to convert a string to uppercase.

Think about The constructor method is called


1 Medium
object lifecycle when an object is created.

Think about
The output will be 10 is a
1 Easy string
concatenation number..

Think about The final keyword is used to


1 Medium
inheritance prevent method overriding.

A multi-dimensional array can


Think about
1 Medium be declared as either int[][] arr;
array syntax
or int arr[][];.
Think about
The main method has a return
1 Medium method return
types type of void.

Think about class Object is the superclass of all


1 Easy
hierarchy classes in Java.
Think about The break statement exits the
1 Medium
control flow loop.
Packages can be imported using
Think about
1 Medium import packageName; or
package usage
import packageName.*;.

Think about The volatile keyword indicates


1 Medium that a variable may be changed
multithreading
by different threads.

Think about A constructor is declared using


1 Medium
constructors ClassName() {}.
Think about The default value of an object
1 Medium object
initialization reference is null.

Think about type The instanceof operator checks


1 Medium if an object is an instance of a
checking
class.
Compilation is not a feature of
Think about OOP
1 Medium Object-Oriented Programming
principles
(OOP).
Think about A package is declared using
1 Medium package
package packageName;.
definition

You might also like