The document outlines various technical modules related to Java programming, specifically focusing on threading, exceptions, collections, and data structures. It includes a series of questions and options related to hash tables, dynamic programming, greedy algorithms, and graph theory. Each section is designed to test knowledge on these topics through multiple-choice questions.
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 ratings0% found this document useful (0 votes)
11 views26 pages
Module-4 & 5-Technical-common to Eee,Ece,Cse
The document outlines various technical modules related to Java programming, specifically focusing on threading, exceptions, collections, and data structures. It includes a series of questions and options related to hash tables, dynamic programming, greedy algorithms, and graph theory. Each section is designed to test knowledge on these topics through multiple-choice questions.
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/ 26
SL.
NO TOPIC NAME SECTION NAME
1 TECHNICAL MODULE 4 2 TECHNICAL MODULE 4 3 TECHNICAL MODULE 4 4 TECHNICAL MODULE 4 5 TECHNICAL MODULE 4 6 TECHNICAL MODULE 4 7 TECHNICAL MODULE 4 8 TECHNICAL MODULE 4 9 TECHNICAL MODULE 4 10 TECHNICAL MODULE 4 11 TECHNICAL MODULE 4 12 TECHNICAL MODULE 4 13 TECHNICAL MODULE 4 14 TECHNICAL MODULE 4 15 TECHNICAL MODULE 4 16 TECHNICAL MODULE 4 17 TECHNICAL MODULE 4 18 TECHNICAL MODULE 4 19 TECHNICAL MODULE 4 20 TECHNICAL MODULE 4 21 TECHNICAL MODULE 4 22 TECHNICAL MODULE 4 23 TECHNICAL MODULE 4 24 TECHNICAL MODULE 4 25 TECHNICAL MODULE 4 26 TECHNICAL MODULE 4 27 TECHNICAL MODULE 4 28 TECHNICAL MODULE 4 29 TECHNICAL MODULE 4 30 TECHNICAL MODULE 4 31 TECHNICAL MODULE 4 32 TECHNICAL MODULE 4 33 TECHNICAL MODULE 4 34 TECHNICAL MODULE 4 35 TECHNICAL MODULE 4 36 TECHNICAL MODULE 4 37 TECHNICAL MODULE 4 38 TECHNICAL MODULE 4 39 TECHNICAL MODULE 4 40 TECHNICAL MODULE 4 41 TECHNICAL MODULE 4 42 TECHNICAL MODULE 4 43 TECHNICAL MODULE 4 44 TECHNICAL MODULE 4 45 TECHNICAL MODULE 4 46 TECHNICAL MODULE 4 47 TECHNICAL MODULE 4 48 TECHNICAL MODULE 4 49 TECHNICAL MODULE 4 50 TECHNICAL MODULE 4 QUESTION TEXT An object can be locked by how many threads at a time? Throwable class contains how many child classes? Which class acts as the root for all Java exception Hierarchy? What is the order of thread states in the Java thread lifecycle, from the initial state to the final state? What is the purpose of synchronization in Java? Which of the following requires less resources What does not prevent JVM from terminating? What decides thread priority? What is true about time slicing? What is true about threading? Exceptions in Java arises during What is the valid syntax for synchronized blocks to get the lock of the current object? Which of these keywords must be used to monitor for exceptions? RuntimeException class is a subclass of? Which of these keywords is used to manually throw an exception? Which of the following keywords is used for throwing exception manually? Which of the following classes can catch all exceptions which cannot be caught? Which of the following is a super class of all exception type classes? Which of the following operators is used to generate instance of an exception which can be thrown using throw? Which of the following keyword is used by a calling function to handle exception thrown by a called function? Which of these class is superclass of String and StringBuffer class? Array can hold? Which of this method of class String is used to obtain a length of String object? Which of the following Collection class allow only Homogeneous elements? ArrayList and LinkedList classes are? Which of these is an incorrect statement? String in Java is a? Which of these method of String class is used to obtain character at specified index? Which of these keywords is used to refer to member of base class from a subclass? Which of these method of String class can be used to test to strings for equality? Which of these packages contain all the collection classes? Which of these classes is not part of Java’s collection framework? Which of this interface is not a part of Java’s collection framework? Which of these methods deletes all the elements from invoking collection? What is Collection in Java? Which of these functions is called to display the output of an applet? Collection is a ____ whereas Collections is ____? Which of these methods is a part of Abstract Window Toolkit (AWT) ? Which of these modifiers can be used for a variable so that it can be accessed from any thread or parts of a program? Which of these operators can be used to get run time information about an object? An applet is a Java class that extends the? Applets are designed to be embedded with in __________. Which of the following is required to view an applet? Which method is automatically called after the browser calls the init method? Which method is only called when the browser shuts down normally? Which of these operators can be used to get run time information about an object? Which method causes the audio clip to replay continually? Collection classes can hold? ___________ method is defined in Graphics class, it is used to output a string in an applet. A method can contain how many synchronized blocks? OPTION A One 2 Exception class New, Running, Blocked, Terminated To make threads run faster Thread Process Process Time slicing is OS service that allocates CPU time to available runnable thread run() method calls start() method and runs the code Run Time synchronized(this) try Error try finally RuntimeException Catchable thrown throws java.util Only Primitive values get() ArrayList, LinkedList Thread-safe classes String objects are immutable, they cannot be changed class char() upper isequal() java.lang Maps List clear() A group of objects display() Interface, Interface display() transient getInfo java.Applet class Javascript JCM start start getInfo public void play() Only Primitive values display() One OPTION B Two 0 Throwable class New, Running, Waiting, Terminated To prevent multiple threads from accessing shared resources simultaneously Process Daemon Thread Process scheduler Time slicing is the process to divide the available CPU time to available runnable thread run() method creates new thread Compilation Time synchronized(super) finally Exception finally try Error RuntimeExceptions alloc throw java.lang Only Object type values Sizeof() HashMap, Hashtable Non-Thread-safe classes String object can point to some other reference of String variable object Charat() super isequals() java.util Array Set reset() A group of classes paint() Interface, Class paint() volatile Info java class CSS JDM stop stop Info public void loop() Only Object type values Print() Two OPTION C Zero 1 Error class Running, New, Blocked, Terminated To allow threads to communicate with each other Thread and Process User Thread Thread Time slicing depends on its implementation in OS run() method can be called directly without start() method being called Can Occur Any Time synchronized(Test.java) throw ArithmeticException throw throw Exception String malloc try ArrayList Both Primitive & Objects type values lengthof() TreeMap, TreeSet Both StringBuffer class is used to store string in a buffer for later use variable charat() this equal() java.net Stack SortedMap delete() A group of interfaces displayApplet() Class, Interface drawString() global instanceof Applet class HTML JVM destroy destroy instanceof public void stop() Both Primitive & Objects type values drawString() Ten OPTION D CORRECT ANSWER Multiple a 3 a None of these b Running, Blocked, Waiting, Terminated b To terminate threads gracefully b Neither Thread nor Process a JVM Thread b Thread scheduler d Time slicing allocates more resources to thread b start() method creates new thread and calls code written in run() method c None of the mentioned a None of these a catch a None of these b catch c catch c ParentException b Throwable d new d catch d None of the mentioned b None of these c length() d None of these c None of these b None of the mentioned c character array a charAt() d none of the mentioned b equals() d java.awt b Queue a SortedList d refresh() a None of the mentioned a PrintApplet() b Class, Class b transient() b No modifier is needed b getinfoof c java.applet.Applet class d SQL c Java Class c paint a paint c getinfoof c None of the above b None of these b transient() c Multiple d S.NO TOPIC NAME SECTION NAME 1 TECHNICAL MODULE 5 2 TECHNICAL MODULE 5 3 TECHNICAL MODULE 5 4 TECHNICAL MODULE 5 5 TECHNICAL MODULE 5 6 TECHNICAL MODULE 5 7 TECHNICAL MODULE 5 8 TECHNICAL MODULE 5 9 TECHNICAL MODULE 5 10 TECHNICAL MODULE 5 11 TECHNICAL MODULE 5 12 TECHNICAL MODULE 5 13 TECHNICAL MODULE 5 14 TECHNICAL MODULE 5 15 TECHNICAL MODULE 5 16 TECHNICAL MODULE 5 17 TECHNICAL MODULE 5 18 TECHNICAL MODULE 5 19 TECHNICAL MODULE 5 20 TECHNICAL MODULE 5 21 TECHNICAL MODULE 5 22 TECHNICAL MODULE 5 23 TECHNICAL MODULE 5 24 TECHNICAL MODULE 5 25 TECHNICAL MODULE 5 26 TECHNICAL MODULE 5 27 TECHNICAL MODULE 5 28 TECHNICAL MODULE 5 29 TECHNICAL MODULE 5 30 TECHNICAL MODULE 5 31 TECHNICAL MODULE 5 32 TECHNICAL MODULE 5 33 TECHNICAL MODULE 5 34 TECHNICAL MODULE 5 35 TECHNICAL MODULE 5 36 TECHNICAL MODULE 5 37 TECHNICAL MODULE 5 38 TECHNICAL MODULE 5 39 TECHNICAL MODULE 5 40 TECHNICAL MODULE 5 41 TECHNICAL MODULE 5 42 TECHNICAL MODULE 5 43 TECHNICAL MODULE 5 44 TECHNICAL MODULE 5 45 TECHNICAL MODULE 5 46 TECHNICAL MODULE 5 47 TECHNICAL MODULE 5 48 TECHNICAL MODULE 5 49 TECHNICAL MODULE 5 50 TECHNICAL MODULE 5 QUESTION TEXT Hash table refers to Which of the following problems is addressed by hash functions in hash tables? What is the main advantage of using a hash table? Which method is commonly used to handle collisions in hash tables? In hash tables, what is a collision? What does the load factor of a hash table represent? Which collision resolution technique uses linked lists? What is the purpose of a rehashing process in a hash table? Which of the following best describes double hashing? What is the expected time complexity for search, insert, and delete operations in a hash table? What is dynamic programming? Which problem characteristic makes it suitable for dynamic programming? What is the main difference between dynamic programming and divide-and-conquer? In dynamic programming, what is the purpose of memoization? Which of the following problems is typically solved using dynamic programming? What is the key characteristic of a problem that allows the use of dynamic programming? Which dynamic programming approach solves subproblems and stores their solutions in a table in a bottom-up manner? What is the time complexity of the dynamic programming solution for the Fibonacci sequence using memoization? Which of the following is a common application of dynamic programming? Which principle is used in dynamic programming to ensure that the global optimal solution is composed of optimal solutions to subproblems? What is a greedy algorithm? Which of the following problems is typically solved using a greedy algorithm? What is the key characteristic of a problem that makes it suitable for a greedy algorithm? Which of the following is a correct example of a greedy choice property? Which algorithm uses a greedy approach to solve the shortest path problem in graphs? What is the primary disadvantage of a greedy algorithm? Which problem cannot be solved optimally by a greedy algorithm? In the activity selection problem, how are activities typically sorted to apply the greedy algorithm? In the coin change problem, what is the greedy algorithm's approach for making change? Which statement best describes the relationship between greedy algorithms and dynamic programming? Which of the following is a characteristic of a directed graph? What does a "cycle" in a graph refer to? Which algorithm is commonly used to find the shortest path in an unweighted graph? What is the time complexity of Depth-First Search (DFS) in terms of vertices VVV and edges EEE? Which of the following statements about Minimum Spanning Trees (MST) is true? Which algorithm can be used to detect negative weight cycles in a graph? In a graph, what is the degree of a vertex? Which traversal algorithm is typically used to find connected components in an undirected graph? What is the primary difference between a tree and a graph? Which graph representation is most efficient for sparse graphs? Which of the following data structures is typically used for implementing a stack? What is the time complexity for inserting an element at the beginning of a singly linked list? Which data structure is best suited for implementing a priority queue? In a binary search tree, what is the average time complexity for search operations? What is a common application of a queue data structure? Which data structure would you use to implement a breadth-first search (BFS) on a graph? What is the primary characteristic of a circular linked list? What type of data structure is a hash table? Which traversal method is used in a binary tree to visit nodes in ascending order? Which of the following operations is typically not supported efficiently by a singly linked list? OPTION A A data structure that maps keys to values using a hash function Sorting elements Fixed size Binary search When two keys hash to different values The number of elements divided by the size of the hash table Linear probing To sort the elements Using two hash functions to handle collisions O(log n) A method for sorting data efficiently Problems that can be divided into overlapping subproblems Dynamic programming uses a recursive approach, while divide-and-conquer uses an ite To sort the results of subproblems Binary search Optimal substructure Memoization O(1) Finding the shortest path in a graph Greedy method An algorithm that always finds the optimal solution by considering all possible solutio Matrix chain multiplication The problem has overlapping subproblems Choosing the smallest available item in the knapsack problem Dijkstra’s algorithm It always finds the optimal solution Fractional knapsack problem By their start times Always choose the smallest denomination coin first Greedy algorithms always provide the optimal solution, whereas dynamic programmin Each edge has a direction associated with it A path with at least one edge Dijkstra’s algorithm O(V) The MST contains all the vertices of the original graph and minimizes the sum of t Dijkstra’s algorithm The number of edges connected to it Breadth-First Search (BFS) Trees do not have cycles, whereas graphs can have cycles Adjacency list Array O(1) Stack O(1) Managing function calls Stack It has a fixed size Linear data structure Pre-order traversal Insertion at the beginning OPTION B
A linear list of elements
Avoiding collisions Ordered data storage Linear probing When a key is not found The total number of keys Quadratic probing To resize the hash table and reduce the load factor Using a hash function twice to reduce collisions O(n) A method for solving complex problems by breaking them down into simpler subproblems Problems that require sorting large datasets Dynamic programming is used for problems without overlapping subproblems To store the results of solved subproblems to avoid redundant computations Matrix chain multiplication Large data sets Recursive approach O(n) Sorting a large list of numbers Optimal substructure An algorithm that makes a series of choices, each of which looks best at the moment Knapsack problem (0/1 variant) The problem has an optimal substructure Selecting the longest path in a graph Floyd-Warshall algorithm It requires extensive backtracking Prim’s minimum spanning tree By their end times Always choose the largest denomination coin first Greedy algorithms solve problems with overlapping subproblems, while dynamic programming does not Each edge has no direction A sequence of vertices starting and ending at the same vertex without repeating any vertex Bellman-Ford algorithm O(E) The MST contains all the edges of the original graph Bellman-Ford algorithm The shortest path length from the vertex to all other vertices Dijkstra’s algorithm Trees can only be undirected, while graphs can only be directed Adjacency matrix Linked list O(n) Binary search tree O(n) Storing data that needs to be processed in a last-in-first-out (LIFO) manner Queue The last node points to the first node, forming a loop Hierarchical data structure In-order traversal Insertion at the end OPTION C A tree structure that sorts data Finding the shortest path Fast insertion, deletion, and lookup operations Quick sort When two keys hash to the same value The maximum number of elements that can be stored Double hashing To handle key-value pair deletions Storing two values for each key O(n^2) A way to execute multiple threads concurrently Problems that are computationally expensive and cannot be simplified Dynamic programming stores results of subproblems to avoid redundant computation To execute subproblems in parallel Quick sort Concurrent processing Iterative approach O(n^2) Compiling a program Iterative deepening An algorithm that sorts data before processing Huffman coding The problem requires all possible solutions to be considered Always picking the item with the highest value-to-weight ratio in the fractional knap Depth-first search It may not always produce an optimal solution Job scheduling with deadlines By their durations Choose coins randomly until the total is met Greedy algorithms make locally optimal choices, while dynamic programming finds th It cannot have cycles A path that visits every vertex exactly once Breadth-First Search (BFS) O(V + E) There can be multiple MSTs with different weights in the same graph Kruskal’s algorithm The number of vertices adjacent to it Bellman-Ford algorithm Trees have exactly two children per node, whereas graphs do not have children Incidence matrix Both array and linked list O(log n) Heap O(log n) Scheduling processes in an operating system Heap Each node points to its previous and next nodes Graph data structure Post-order traversal Deletion from the beginning OPTION D
A sequential array for storing elements
Allocating memory Easy to implement Depth-first search When a key's value is null The efficiency of the hash function Separate chaining To compress the hash values Allocating memory twice for each key-value pair O(1) A technique for compressing data Problems that involve concurrent processing Divide-and-conquer is used for problems with overlapping subproblems, while dynamic programming is not To delete results of subproblems after use Depth-first search High memory usage Divide-and-conquer O(log n) Creating a binary tree Breadth-first search An algorithm that processes data in parallel Sorting a list of numbers The problem has a globally optimal solution that can be reached by making locally optimal choices Dividing the problem into overlapping subproblems Bellman-Ford algorithm It is difficult to implement 0/1 knapsack problem By their values Use dynamic programming to find the optimal solution Dynamic programming is a subset of greedy algorithms It must be acyclic A subgraph with no edges Depth-First Search (DFS) O(V * E) The MST is always unique for any graph Prim’s algorithm The weight of the vertex Kruskal’s algorithm Trees have more vertices than graphs Edge list Hash table O(n log n) Queue O(n log n) Performing depth-first search in graphs Hash table It has a dummy head node Associative array Associative array Random access of elements CORRECT ANSWER A B C B C A D B A D B A C B B A C B A B B C D C A C D B B C A B C C A B A A A A C A C C C B B D B D