Showing 21–30 of 271 questions
If PAPER is coded as 16-1-16-5-18, then PENCIL would be coded as?
A
16-5-14-3-9-12
B
16-5-13-3-9-12
C
15-5-14-3-9-12
D
16-5-14-2-9-12
Correct Answer:
A. 16-5-14-3-9-12
EXPLANATION
Each letter is coded as its position in the alphabet: P=16, A=1, P=16, E=5, R=18. Similarly, PENCIL: P=16, E=5, N=14, C=3, I=9, L=12.
In a sequence, each term is obtained by adding the previous two terms. If the 1st term is 2 and 2nd term is 3, what is the 6th term?
EXPLANATION
Fibonacci-like sequence: T1=2, T2=3, T3=5, T4=8, T5=13, T6=21. Each term = sum of previous two terms.
What does the SELECT * query do in SQL?
A
Selects the first row
B
Selects all columns from all rows
C
Selects only the primary key
D
Deletes all data
Correct Answer:
B. Selects all columns from all rows
EXPLANATION
SELECT * retrieves all columns and rows from a table. * is a wildcard meaning 'all columns'.
Which protocol is used for secure data transmission over the internet?
A
HTTP
B
HTTPS
C
FTP
D
SMTP
EXPLANATION
HTTPS (HTTP Secure) encrypts data in transit using SSL/TLS. Other protocols lack this encryption.
What is the purpose of the 'try-catch' block in Java?
A
To improve code performance
B
To handle exceptions gracefully
C
To declare variables
D
To create loops
Correct Answer:
B. To handle exceptions gracefully
EXPLANATION
try-catch blocks allow you to handle exceptions without crashing the program, providing graceful error handling.
Which of the following is NOT a principle of object-oriented programming?
A
Inheritance
B
Encapsulation
C
Polymorphism
D
Materialization
Correct Answer:
D. Materialization
EXPLANATION
The four OOP principles are Inheritance, Encapsulation, Polymorphism, and Abstraction. 'Materialization' is not an OOP principle.
Which design pattern is used when you want to ensure a class has only one instance?
A
Factory Pattern
B
Singleton Pattern
C
Builder Pattern
D
Observer Pattern
Correct Answer:
B. Singleton Pattern
EXPLANATION
Singleton Pattern restricts a class to have only one instance and provides a global access point to it.
In the context of REST APIs, what does POST primarily do?
A
Retrieve data
B
Create new resources
C
Update existing resources
D
Delete resources
Correct Answer:
B. Create new resources
EXPLANATION
POST method is used to create new resources on the server. GET retrieves, PUT/PATCH updates, DELETE removes.
What does the idiom 'break the ice' mean?
A
To literally break ice
B
To initiate conversation in a social setting
C
To make something cold
D
To surprise someone
Correct Answer:
B. To initiate conversation in a social setting
EXPLANATION
'Break the ice' idiomatically means to initiate conversation or ease tension in a social situation.
Complete the sentence: 'Despite his wealth, he lived _____ lifestyle.'
A
a modest
B
an modest
C
the modest
D
modest
Correct Answer:
A. a modest
EXPLANATION
'A modest' is grammatically correct. 'Modest' starts with a consonant sound, so we use 'a' not 'an'.