Result for: shravani rathod
Exam Details
Download Result (PDF)Question Analysis
| Sr. No. | Question | Selected Answer | Correct Answer |
|---|---|---|---|
| 1 | Find the output of the given while loop. | 6 | 6 |
| 2 | How many times does the print statement execute in this nested loop? | 3 | 3 |
| 3 | Calculate the final output of the code snippet. | 15 | 15 |
| 4 | What will be the output after values are swapped? | 20 10 | 20 10 |
| 5 | Predict the output for this Fibonacci-like loop. | 8 | 8 |
| 6 | Find the count of numbers divisible by 3 or 5 between 1 to 10. | 3 | 5 |
| 7 | What is the final sum of the squares loop? | 55 | 55 |
| 8 | Determine the output of this nested if-else block. | C | B |
| 9 | What is the output when the loop encounters a break statement? | 2000 1 2 | 2000 1 2 |
| 10 | Find the total iterations of the nested loop (x value). | 10 | 10 |
| 11 | Time complexity of a single loop? | O(log n) | O(n) |
| 12 | Nested loop complexity? | O(n) | O(n²) |
| 13 | Binary search complexity? | O(1) | O(log n) |
| 14 | Best case HashMap get() complexity? | O(log n) | O(1) |
| 15 | Which of the following is the fastest complexity? | O(n log n) | O(log n) |
| 16 | Root class of all exceptions in Java? | Throwable | Throwable |
| 17 | Which of these is an Unchecked exception? | NullPointerException | NullPointerException |
| 18 | What is the purpose of the finally block? | Stop JVM | Cleanup |
| 19 | Is a try block without a catch possible? | Always | Yes with finally |
| 20 | Keyword used to explicitly throw an exception? | throw | throw |
| 21 | Which collection allows duplicate elements? | Map | List |
| 22 | Which Set maintains insertion order? | HashSet | LinkedHashSet |
| 23 | How many null keys are allowed in a HashMap? | 2 | 1 |
| 24 | Which of these is a synchronized collection? | HashMap | Vector |
| 25 | Root interface of the Collection Framework? | Collection | Collection |
| 26 | Method overriding is an example of? | Inheritance | Polymorphism |
| 27 | Keyword used to prevent inheritance? | static | final |
| 28 | Data hiding is primarily achieved by? | Polymorphism | Encapsulation |
| 29 | Can an abstract class have a constructor? | Only static | Yes |
| 30 | Multiple inheritance in Java is achieved using? | Objects | Interfaces |
| 31 | Stream API was introduced in which Java version? | Java 6 | Java 8 |
| 32 | Which of these is a Terminal operation in Streams? | filter | collect |
| 33 | Stream operations are generally? | Static | Lazy |
| 34 | Method used to transform/map elements in a Stream? | reduce | map |
| 35 | What does the findFirst() method return? | Optional | Optional |
| 36 | In which package is the Comparable interface found? | java.lang | java.lang |
| 37 | Comparator is primarily used for? | Hashing | Custom sort |
| 38 | Which method is defined in the Comparable interface? | equals | compareTo |
| 39 | What provides platform independence in Java? | JDK | Bytecode |
| 40 | Which code calculates the total salary of active employees? | Option B | Option B |
| 41 | What is the main purpose of hashing? | Fast lookup | Fast lookup |
| 42 | Which method is used for hashing in Java? | hashCode | hashCode |
| 43 | What will be the size of the HashSet in the given code? | 3 | 1 |
| 44 | Time complexity of the given nested loop (j = j * 2)? | O(n log n) | O(n log n) |
| 45 | What is the time complexity? | O(n log n) | O(n²) |
| 46 | What is the time complexity? | O(n²) | O(n² log n) |
| 47 | What is the time complexity? | O(log n) | O(n log n) |
| 48 | What is the time complexity? | O(n²) | O(n²) |
| 49 | Thread t = new Thread(() -> System.out.println("Run")); t.run(); | Runs in main thread | Runs in main thread |
| 50 | What is the result of class C implementing interfaces A and B? | A B | Compilation error |
Page 1