What is the main difference between an array and a linked list?
Answer: B
Arrays allocate continuous memory blocks; linked lists use nodes scattered in memory
Q.13Medium
Which of the following is NOT a cloud service model?
Answer: D
SaaS (Software as Service), PaaS (Platform as Service), IaaS (Infrastructure as Service) are main cloud models. DaaS is Data as Service but not standard
Q.14Medium
Which sorting algorithm has the best average time complexity?
Answer: B
Quick sort has average time complexity O(n log n), better than bubble sort O(n²)
Q.15Medium
What is encapsulation in OOP?
Answer: B
Encapsulation is bundling data (variables) and methods together while hiding implementation details
Q.16Medium
What is the default access modifier in Java?
Answer: D
If no modifier is specified in Java, it defaults to package-private (accessible within the same package)
Q.17Medium
Which of the following best describes a compiler?
Answer: B
A compiler translates the entire program before execution (unlike interpreters which translate line by line)
Q.18Medium
What does MVC stand for in web development?
Answer: A
MVC (Model View Controller) is an architectural pattern separating data, presentation, and logic
Q.19Medium
If COMPUTER is coded as FRPSXGVQ, how is KEYBOARD coded?
Answer: B
Each letter is shifted 3 positions forward in the alphabet (C→F, O→R, M→P, P→S, U→X, T→W, E→H, R→U). Applying the same to KEYBOARD: K→N, E→H, Y→B, B→E, O→R, A→D, R→U, D→G, wait—checking pattern: K(11)→N(14), E(5)→H(8), Y(25)→B(2), B(2)→E(5), O(15)→R(18), A(1)→D(4), R(18)→U(21), D(4)→G(7). KEYBOARD→NEYERMYNO confirms the +3 shift with wraparound.
Q.20Medium
What is the output of this code snippet? int x = 5; int y = ++x + x++ + x; System.out.println(x); System.out.println(y);
Answer: C
Starting with x=5. ++x increments x to 6 and returns 6. x++ uses 6 and then increments x to 7. The third x uses 7. So y = 6 + 6 + 7 = 19. After the expression, x=8 (post-increment from x++ happens after the expression). Final: x=8, y=19.