Quest Eduventuures Internship Test

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Deepeshkankaria
D
Deepeshkankaria
Community Contributor
Quizzes Created: 1 | Total Attempts: 140
| Attempts: 140
SettingsSettings
Please wait...
  • 1/60 Questions

    A short sections of code written to complete a task. 

    • Buffer
    • Array
    • Function
Please wait...
About This Quiz


This test is designed to check the analytical, logical and computer programming skills of an individual.

Quest Eduventuures Internship Test - Quiz

Quiz Preview

  • 2. 

    What is FIFO?

    • First in Few Out

    • Few In Few out

    • First In First Out

    • Few In First Out

    Correct Answer
    A. First In First Out
    Explanation
    FIFO stands for "First In First Out." It is a method of organizing and manipulating data where the first item that is inserted or added into a data structure is the first one to be removed or processed. This concept is commonly used in various fields, such as computing, inventory management, and queueing systems. It ensures that items are processed or handled in the order they arrive, maintaining the chronological order of the data.

    Rate this question:

  • 3. 

    One loop inside the body of another loop is called 

    • Loop in loop

    • Nested

    • Double loops

    Correct Answer
    A. Nested
    Explanation
    When one loop is placed inside the body of another loop, it is referred to as a nested loop. The outer loop controls the number of times the inner loop will execute. This allows for more complex and intricate looping structures, where the inner loop can perform a set of actions multiple times within each iteration of the outer loop. The term "nested" is used because the loops are visually represented as being inside one another, similar to how nesting dolls fit inside each other.

    Rate this question:

  • 4. 

    Which of the following case does not exist in complexity theory

    • Best case

    • Worst case

    • Average case

    • Null case

    Correct Answer
    A. Null case
    Explanation
    The null case does not exist in complexity theory because it refers to a scenario where there is no input or no operations to be performed. In complexity theory, the focus is on analyzing the performance of algorithms in different scenarios, such as best case, worst case, and average case, where there is input and operations to be considered. The null case is not relevant in this context as it does not involve any input or operations to analyze.

    Rate this question:

  • 5. 

    A do while and a while loop are the same

    • True

    • False

    Correct Answer
    A. False
    Explanation
    A do-while loop and a while loop are not the same. The main difference between them is that a while loop checks the condition before executing the loop, while a do-while loop checks the condition after executing the loop. This means that a do-while loop will always execute at least once, regardless of the condition being true or false. In contrast, a while loop may not execute at all if the condition is initially false. Therefore, the correct answer is False.

    Rate this question:

  • 6. 

    What dose this equation mean ? a != t

    • A is assinged t

    • A and t are equal

    • A is not equal to t

    • T is add to a

    Correct Answer
    A. A is not equal to t
    Explanation
    The equation "a != t" means that variable a is not equal to variable t. It is a comparison statement indicating that the values assigned to a and t are different.

    Rate this question:

  • 7. 

    Entering Comments is a useless task, it will  not help in anyway.

    • True

    • False

    Correct Answer
    A. False
    Explanation
    The given statement suggests that entering comments is a useless task and will not help in any way. The correct answer is "False" because entering comments can be helpful in various ways. Comments can provide additional information, explanations, or clarifications, making the code more understandable for other programmers. They can also serve as reminders or notes for the developer themselves, helping them remember the purpose or functionality of certain code sections. Therefore, entering comments can be a valuable practice in programming.

    Rate this question:

  • 8. 

    The operation of processing each element in the list is known as

    • Sorting

    • Merging

    • Inserting

    • Traversal

    Correct Answer
    A. Traversal
    Explanation
    Traversal refers to the process of accessing each element in a list or data structure one by one. It involves visiting and examining each element without changing their order or structure. In this context, the operation of processing each element in the list is referred to as traversal. Sorting involves rearranging the elements in a specific order, merging combines two or more lists into a single list, and inserting involves adding an element at a specific position in the list.

    Rate this question:

  • 9. 

    Two main measures for the efficiency of an algorithm are

    • Processor and memory

    • Complexity and capacity

    • Time and space

    • Data and space

    Correct Answer
    A. Time and space
    Explanation
    The efficiency of an algorithm is typically measured by its time complexity and space complexity. Time complexity refers to the amount of time it takes for the algorithm to run, while space complexity refers to the amount of memory or space required by the algorithm to solve a problem. Therefore, the correct answer is "Time and space" as these two measures are commonly used to evaluate the efficiency of an algorithm.

    Rate this question:

  • 10. 

    The Average case occur in linear search algorithm

    • When Item is somewhere in the middle of the array

    • When Item is not in the array at all

    • When Item is the last element in the array

    • When Item is the last element in the array or is not there at all

    Correct Answer
    A. When Item is somewhere in the middle of the array
    Explanation
    The average case in linear search occurs when the item being searched for is somewhere in the middle of the array. In this case, the algorithm will need to iterate through approximately half of the array before finding the item. This is because linear search checks each element of the array one by one until it either finds the item or reaches the end of the array. Therefore, on average, the algorithm will need to iterate through half of the array to find the desired item.

    Rate this question:

  • 11. 

    Finding the location of the element with a given value is:

    • Traversal

    • Search

    • Sort

    • None of above

    Correct Answer
    A. Search
    Explanation
    The correct answer is "Search" because finding the location of an element with a given value involves searching through a data structure or collection to locate the desired element. Traversal refers to the process of accessing each element in a data structure, while sorting involves arranging elements in a specific order. Therefore, "Search" is the most appropriate term for finding the location of an element with a given value.

    Rate this question:

  • 12. 

    Which data structure uses LIFO?

    • Array

    • Int

    • Stacks

    • Queues

    Correct Answer
    A. Stacks
    Explanation
    Stacks use the LIFO (Last-In-First-Out) principle, where the last element added to the stack is the first one to be removed. This means that when an element is inserted into a stack, it is placed on top of the previously inserted elements. When an element is removed from the stack, the topmost element is removed first. This behavior is similar to a stack of plates, where the last plate placed on top is the first one to be removed. Therefore, the correct answer is Stacks.

    Rate this question:

  • 13. 

    A memory location that holds a single letter or number.  

    • Double

    • Int

    • Char

    • Word

    Correct Answer
    A. Char
    Explanation
    A char is a data type in programming that represents a single letter or number. It is used to store characters such as letters, digits, and symbols. In memory, a char variable occupies a single memory location, making it suitable for storing a single character. The other data types mentioned in the options, such as double and int, are used to store numbers with different precision and range. The option "word" is not a valid data type in most programming languages.

    Rate this question:

  • 14. 

    Which of the following data structure is linear data structure?

    • Trees

    • Graphs

    • Arrays

    • None of above

    Correct Answer
    A. Arrays
    Explanation
    Arrays are a linear data structure because they store elements in a sequential manner. Each element in an array can be accessed by its index, which represents its position in the array. This allows for efficient traversal and retrieval of elements. Arrays have a fixed size and elements are stored contiguously in memory, making them suitable for tasks such as sorting and searching. Trees and graphs, on the other hand, are non-linear data structures as they allow for more complex relationships between elements.

    Rate this question:

  • 15. 

    I have a table contains a large number of rows (the relevant table structure is abbreviated here) for this CREATE TABLE FirstTable (ID INT, Col VARCHAR(100)) GO CREATE INDEX IX_Col ON FirstTable (Col);   I have this stored procedure CREATE PROC Test_1    @Get NVARCHAR(20) AS  SELECT ID,Col   FROM FirstTable   WHERE Col = @Get; The execution of Test_1 results in a table scan. I can NOT alter the table in any way. I have permission to alter the procedure. The question is: Can I alter the procedure to do an index seek?

    • True

    • False

    Correct Answer
    A. True
    Explanation
    The stored procedure Test_1 can be altered to do an index seek by adding the keyword "OPTION (RECOMPILE)" at the end of the SELECT statement. This will allow the query optimizer to generate a new execution plan each time the stored procedure is executed, taking into account the current parameter value. Since the index on the Col column exists, the query optimizer will be able to use it for an index seek operation instead of a table scan.

    Rate this question:

  • 16. 

    Each array declaration need not give, implicitly or explicitly, the information about

    • The name of array

    • the data type of array

    • The first data from the set to be stored

    • The index set of the array

    Correct Answer
    A. The first data from the set to be stored
    Explanation
    The first data from the set to be stored is not required to be specified in the array declaration. The array declaration only needs to include the name of the array and the data type of the array. The first data from the set to be stored can be assigned later when the array is initialized or when values are assigned to specific indices of the array.

    Rate this question:

  • 17. 

    Logically analyze the information given below and answer this question:   Who is the CEO? At a small company, parking spaces are reserved for the top executives: CEO, president, vice president, secretary, and treasurer with the spaces lined up in that order. The parking lot guard can tell at a glance if the cars are parked correctly by looking at the color of the cars. The cars are yellow, green, purple, red, and blue, and the executives names are Alice, Bert, Cheryl, David, and Enid.   * The car in the first space is red. * A blue car is parked between the red car and the green car. * The car in the last space is purple. * The secretary drives a yellow car. * Alice's car is parked next to David's. * Enid drives a green car. * Bert's car is parked between Cheryl's and Enid's. * David's car is parked in the last space.

    • Alice

    • Bert

    • Cheryl

    • David

    • Enid

    Correct Answer
    A. Cheryl
    Explanation
    Based on the given information, we can deduce the following:

    1. The car in the first space is red.
    2. A blue car is parked between the red car and the green car.
    3. The car in the last space is purple.
    4. The secretary drives a yellow car.
    5. Alice's car is parked next to David's.
    6. Enid drives a green car.
    7. Bert's car is parked between Cheryl's and Enid's.
    8. David's car is parked in the last space.

    From statement 7, we know that Bert's car is parked between Cheryl's and Enid's. Since David's car is parked in the last space, and Alice's car is parked next to David's (statement 5), Cheryl must be the CEO.

    Rate this question:

  • 18. 

    Logically analyze the information given below and answer this question:   How much rain did Mile City get? Five cities all got more rain than usual this year. The five cities are: Last Stand, Mile City, New Town, Olliopolis, and Polberg. The cities are located in five different areas of the country: the mountains, the forest, the coast, the desert, and in a valley. The rainfall amounts were: 12 inches, 27 inches, 32 inches, 44 inches, and 65 inches. * The city in the desert got the least rain; the city in the forest got the most rain. * New Town is in the mountains. * Last Stand got more rain than Olliopolis. * Mile City got more rain than Polberg, but less rain than New Town. * Olliopolis got 44 inches of rain. * The city in the mountains got 32 inches of rain; the city on the coast got 27 inches of rain.

    • 12 inches

    • 27 inches

    • 32 inches

    • 44 inches

    • 65 inches

    Correct Answer
    A. 27 inches
    Explanation
    Based on the given information, we can deduce that Mile City got more rain than Polberg, but less rain than New Town. We also know that the city on the coast got 27 inches of rain. Therefore, the answer is 27 inches, as it is the only rainfall amount that falls within the range of possibilities for Mile City.

    Rate this question:

  • 19. 

    Arrays are best data structures

    • For relatively permanent collections of data

    • For the size of the structure and the data in the structure are constantly changing

    • For both of above situation

    • For none of above situation

    Correct Answer
    A. For relatively permanent collections of data
    Explanation
    Arrays are best data structures for relatively permanent collections of data because arrays have a fixed size and are suitable for storing a fixed number of elements. They provide efficient random access to elements and have a simple and straightforward implementation. However, arrays are not suitable for situations where the size of the structure and the data in the structure are constantly changing, as arrays cannot dynamically resize themselves. Therefore, the correct answer is that arrays are best for relatively permanent collections of data.

    Rate this question:

  • 20. 

    The complexity of linear search algorithm is

    • O(n)

    • O(log n)

    • O(n2)

    • O(n log n)

    Correct Answer
    A. O(n)
    Explanation
    The complexity of the linear search algorithm is O(n) because it has to iterate through each element in the list until it finds the desired element or reaches the end of the list. This means that the time it takes to complete the algorithm grows linearly with the size of the input.

    Rate this question:

  • 21. 

    A Syntax Error is ? 

    • An error you will never find

    • An error you find at the end when the program gives out a wrong value due to logic error

    • An error caused by language rules being broken.

    • An error due to user error

    Correct Answer
    A. An error caused by language rules being broken.
    Explanation
    A Syntax Error is an error caused by language rules being broken. Syntax refers to the rules and structure of a programming language. When these rules are violated, such as using incorrect syntax or missing semicolons, the program will not be able to execute properly and will throw a syntax error. This type of error can be easily identified by the compiler or interpreter, as it is a violation of the language's syntax rules.

    Rate this question:

  • 22. 

    What command do you use to output data to the screen?

    • Cin

    • Cout>>

    • Cout

    • Output>>

    Correct Answer
    A. Cout
    Explanation
    The correct answer is "cout". In C++, "cout" is a standard output stream object that is used to display output on the screen. It is commonly used with the insertion operator "

    Rate this question:

  • 23. 

    The Worst case occur in linear search algorithm when

    • Item is somewhere in the middle of the array

    • Item is not in the array at all

    • Item is the last element in the array

    • Item is the last element in the array or is not there at all

    Correct Answer
    A. Item is the last element in the array or is not there at all
    Explanation
    In linear search, the algorithm starts searching from the beginning of the array and continues until it finds the desired item or reaches the end of the array. In the worst case scenario, the item being searched for is either the last element in the array or not present at all. If the item is the last element, the algorithm will have to iterate through the entire array before finding it. Similarly, if the item is not present in the array, the algorithm will have to search through the entire array without finding it. In both cases, the worst case time complexity is O(n), where n is the size of the array.

    Rate this question:

  • 24. 

    Int hold decemals numbers

    • True

    • False

    Correct Answer
    A. False
    Explanation
    This statement is incorrect because the word "decemals" is misspelled. The correct spelling is "decimals." Therefore, the correct answer is False.

    Rate this question:

  • 25. 

    The complexity of Bubble sort algorithm is

    • O(n)

    • O(log n)

    • O(n2)

    • O(n log n)

    Correct Answer
    A. O(n2)
    Explanation
    Bubble sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The algorithm has a time complexity of O(n2), which means that the number of operations required to sort the list is proportional to the square of the number of elements in the list. This is because in the worst case scenario, where the list is in reverse order, each element needs to be compared with every other element, resulting in n comparisons for each of the n elements. Therefore, the time complexity is O(n2).

    Rate this question:

  • 26. 

    What will be the output of the program? public class X {     public static void main(String [] args)     {         try         {             badMethod();              System.out.print("A");         }          catch (Exception ex)         {             System.out.print("B");         }          finally         {             System.out.print("C");         }          System.out.print("D");     }      public static void badMethod() {} }

    • AC

    • BC

    • ACD

    • ABCD

    Correct Answer
    A. ACD
    Explanation
    The program will output "ACD". The main method calls the badMethod() method, which is empty and does nothing. Since there is no exception thrown in the try block, the catch block is not executed. The finally block is always executed, so "C" is printed. After the finally block, "D" is printed. Therefore, the output is "ACD".

    Rate this question:

  • 27. 

    Which of the following data structure is not linear data structure?

    • Arrays

    • Linked lists

    • Both of above

    • None of above

    Correct Answer
    A. None of above
    Explanation
    The correct answer is "None of above". This means that both arrays and linked lists are linear data structures. Arrays store elements in contiguous memory locations, allowing for efficient random access. Linked lists, on the other hand, store elements in separate nodes that are connected through pointers, allowing for efficient insertion and deletion operations. Therefore, both arrays and linked lists are examples of linear data structures.

    Rate this question:

  • 28. 

    What will be the output of the program? class Test {     public static void main(String [] args)     {         int x=20;         String sup = (x < 15) ? "small" : (x < 22)? "tiny" : "huge";         System.out.println(sup);     } }

    • Small

    • Tiny

    • Huge

    • Compilation fails

    Correct Answer
    A. Tiny
    Explanation
    The output of the program will be "tiny". This is because the ternary operator is used to assign the value of the variable "sup". The condition (x < 15) evaluates to false, so the next condition (x < 22) is checked. Since x is equal to 20, this condition is true and the value "tiny" is assigned to "sup". Therefore, "tiny" is printed as the output.

    Rate this question:

  • 29. 

    Linked lists are best suited

    • For relatively permanent collections of data

    • for the size of the structure and the data in the structure are constantly changing

    • For both of above situation

    • For none of above situation

    Correct Answer
    A. for the size of the structure and the data in the structure are constantly changing
    Explanation
    Linked lists are best suited for situations where the size of the structure and the data in the structure are constantly changing. This is because linked lists allow for efficient insertion and deletion of elements at any position in the list, without the need to shift or resize the entire structure. Unlike arrays, which have a fixed size, linked lists can dynamically adjust their size to accommodate changes in the data. This makes linked lists a flexible and efficient choice for managing collections of data that are constantly being modified.

    Rate this question:

  • 30. 

    The complexity of merge sort algorithm is

    • O(n)

    • O(log n)

    • O(n2)

    • O(n log n)

    Correct Answer
    A. O(n log n)
    Explanation
    The complexity of merge sort algorithm is O(n log n) because it divides the input array into two halves, recursively sorts them, and then merges the two sorted halves. The time complexity of merging two sorted arrays of size n/2 each is O(n), and the time complexity of dividing the array into halves is O(log n). Hence, the overall time complexity is O(n log n).

    Rate this question:

  • 31. 

    The space factor when determining the efficiency of algorithm is measured by

    • Counting the maximum memory needed by the algorithm

    • Counting the minimum memory needed by the algorithm

    • Counting the average memory needed by the algorithm

    • Counting the maximum disk space needed by the algorithm

    Correct Answer
    A. Counting the maximum memory needed by the algorithm
    Explanation
    The space factor when determining the efficiency of an algorithm is measured by counting the maximum memory needed by the algorithm. This means that the efficiency of the algorithm is evaluated based on the maximum amount of memory it requires to execute. By considering the maximum memory usage, we can assess how well the algorithm performs in terms of space utilization. This information is crucial for optimizing the algorithm and ensuring that it can run efficiently within the available memory resources.

    Rate this question:

  • 32. 

    Which collection class allows you to associate its elements with key values, and allows you to retrieve objects in FIFO (first-in, first-out) sequence?

    • Java.util.ArrayList

    • Java.util.LinkedHashMap

    • Java.util.HashMap

    • Java.util.TreeMap

    Correct Answer
    A. Java.util.LinkedHashMap
    Explanation
    A LinkedHashMap in Java allows you to associate its elements with key values, meaning you can store objects with specific keys. It also allows you to retrieve objects in FIFO sequence, meaning the elements are returned in the order they were added to the map. This makes it a suitable choice for scenarios where both key-value associations and maintaining insertion order are important.

    Rate this question:

  • 33. 

    The complexity of the average case of an algorithm is

    • Much more complicated to analyze than that of worst case

    • Much more simpler to analyze than that of worst case

    • Sometimes more complicated and some other times simpler than that of worst case

    • None or above

    Correct Answer
    A. Much more complicated to analyze than that of worst case
    Explanation
    The complexity of the average case of an algorithm is much more complicated to analyze than that of the worst case because it requires considering a range of possible inputs and their probabilities. The worst case complexity only considers the maximum possible input size, while the average case complexity takes into account the likelihood of different input sizes and distributions. This makes the analysis of average case complexity more complex and time-consuming compared to the worst case.

    Rate this question:

  • 34. 

    The elements of an array are stored successively in memory cells because

    • By this way computer can keep track only the address of the first element and the addresses of other elements can be calculated

    • the architecture of computer memory does not allow arrays to store other than serially

    • Both of above

    • None of above

    Correct Answer
    A. By this way computer can keep track only the address of the first element and the addresses of other elements can be calculated
    Explanation
    The elements of an array are stored successively in memory cells because by this way the computer can keep track only the address of the first element and the addresses of other elements can be calculated. This allows for efficient memory management and easy access to array elements by using indexing based on the address of the first element. Storing elements in a serial manner also aligns with the architecture of computer memory, making it a suitable approach for array storage.

    Rate this question:

  • 35. 

    Which cause a compiler error? (choose all that apply)

    • Float[ ] f = new float(3);

    • Float f2[ ] = new float[ ];

    • Float[ ]f1 = new float[3];

    • Float f3[ ] = new float[3];

    Correct Answer(s)
    A. Float[ ] f = new float(3);
    A. Float f2[ ] = new float[ ];
    Explanation
    The correct answers are "float[ ] f = new float(3);" and "float f2[ ] = new float[ ];".

    The first line of code tries to initialize an array of floats with the size of 3 using the incorrect syntax. The correct syntax for initializing an array with a specific size is "new float[3]".

    The second line of code tries to declare an array of floats without specifying the size. In Java, when declaring an array, the size must be specified. Therefore, the correct syntax for declaring an array without specifying the size would be "float[] f2;".

    Rate this question:

  • 36. 

    try {     int x = 0;     int y = 5 / x; } catch (Exception e) {     System.out.println("Exception"); } catch (ArithmeticException ae) {     System.out.println(" Arithmetic Exception"); } System.out.println("finished");   State True or False: The output of the above code is the below Exception finished

    • True

    • False

    Correct Answer
    A. False
    Explanation
    The output of the above code is "Arithmetic Exception" followed by "finished". This is because the code attempts to divide 5 by 0, which results in an ArithmeticException being thrown. Since the catch block for ArithmeticException comes before the catch block for Exception, it is the one that catches the exception and prints "Arithmetic Exception". After the catch blocks, the code continues to execute and prints "finished". Therefore, the correct answer is False.

    Rate this question:

  • 37. 

    The time factor when determining the efficiency of algorithm is measured by

    • Counting microseconds

    • Counting the number of key operations

    • Counting the number of statements

    • Counting the kilobytes of algorithm

    Correct Answer
    A. Counting the number of key operations
    Explanation
    The efficiency of an algorithm is determined by counting the number of key operations it performs. Key operations refer to the fundamental steps or operations that the algorithm needs to execute in order to solve a problem. By counting these key operations, we can get an idea of the time complexity of the algorithm, which helps us understand how the algorithm will perform as the input size increases. Counting microseconds, the number of statements, or the kilobytes of the algorithm are not accurate measures of the time factor in determining efficiency.

    Rate this question:

  • 38. 

    Class X implements Runnable {     public static void main(String args[])     {         /* Missing code? */     }     public void run() {} } Which of the following line of code is suitable to start a thread ?

    • Thread t = new Thread(X);

    • Thread t = new Thread(X); t.start();

    • X run = new X(); Thread t = new Thread(run); t.start();

    • Thread t = new Thread(); x.run();

    Correct Answer
    A. X run = new X(); Thread t = new Thread(run); t.start();
    Explanation
    The correct answer is "X run = new X(); Thread t = new Thread(run); t.start();". This line of code creates an instance of the class X and then creates a new thread using that instance. The thread is then started using the start() method.

    Rate this question:

  • 39. 

    What will be the output of the program? class Bitwise {     public static void main(String [] args)     {         int x = 11 & 9;         int y = x ^ 3;         System.out.println( y | 12 );     } }

    • 0

    • 7

    • 8

    • 14

    Correct Answer
    A. 14
    Explanation
    The program first performs a bitwise AND operation between 11 and 9, resulting in the value 9. Then, it performs a bitwise XOR operation between the result (9) and 3, resulting in the value 10. Finally, it performs a bitwise OR operation between the result (10) and 12, resulting in the value 14. Therefore, the output of the program will be 14.

    Rate this question:

  • 40. 

    Four usual dice are thrown on the ground. The total of numbers on the top faces of these four dice is 13 as the top faces showed 4, 3, 1 and 5 respectively. What is the total of the faces touching the ground?

    • 12

    • 13

    • 15

    • Cannot be determined

    Correct Answer
    A. 15
    Explanation
    The total of the numbers on the top faces of the four dice is 13. Since each die has six faces and the sum of the numbers on opposite faces is always 7, we can determine that the total of the faces touching the ground is 15.

    Rate this question:

  • 41. 

    Which three guarantee that a thread will leave the running state?
    1. yield()
    2. wait()
    3. notify()
    4. notifyAll()
    5. sleep(1000)
    6. aLiveThread.join()
    7. Thread.killThread()

    • 1,2 and 4

    • 2,5 and 6

    • 3,4 and 7

    • 4,5 and 7

    Correct Answer
    A. 2,5 and 6
  • 42. 

    Public class Runner {                 public static void main(String args[])                 {                     System.out.println(“This is a correct program”);                     continue;                 } } State True or False: The above program prints a output

    • True

    • False

    Correct Answer
    A. False
    Explanation
    The above program will not compile because the continue statement is used outside of a loop. The continue statement is used to skip the current iteration of a loop and move to the next iteration. Since there is no loop in the program, the continue statement is invalid and will result in a compilation error. Therefore, the program will not print any output.

    Rate this question:

  • 43. 

    Which of the following would compile without error?

    • Int a = Math.abs(-5);

    • Int b = Math.abs(5.0);

    • Int c = Math.abs(5.5F);

    • Int d = Math.abs(5L);

    Correct Answer
    A. Int a = Math.abs(-5);
    Explanation
    The code int a = Math.abs(-5); would compile without error because Math.abs() is a method in the Math class that returns the absolute value of a number. In this case, it returns the absolute value of -5, which is 5. Since the variable a is of type int, it can store the result without any issues.

    Rate this question:

  • 44. 

    In the following question, two statements numbered I and II are given. There may be cause and effect relationship between the two statements. These two statements may be the effect of the same cause or independent causes. These statements may be independent causes without having any relationship. Read both the statements in each question and mark your answer as:   (A) If statement I is the cause and statement II is its effect; (B) If statement II is the cause and statement I is its effect; (C) If both the statements I and II are independent causes; (D) If both the statements I and II are effects of independent causes; and (E) If both the statements I and II are effects of some common cause. Statements: I.  The Reserve Bank of India has recently put restrictions on few small banks in the country. II.  The small banks in the private and co-operative sector in India are not in a position to withstand the competitions of the bigger in the public sector.

    • (A)

    • (B)

    • (C)

    • (D)

    • (E)

    Correct Answer
    A. (B)
    Explanation
    Statement II is the cause and statement I is its effect. The reason for the Reserve Bank of India putting restrictions on few small banks is that these banks are not able to compete with the bigger banks in the public sector. Therefore, the inability of small banks to withstand the competition is the cause, and the restriction imposed by the Reserve Bank of India is the effect.

    Rate this question:

  • 45. 

    The complexity of Binary search algorithm is

    • O(n)

    • O(log )

    • O(n2)

    • O(n log n)

    Correct Answer
    A. O(log )
  • 46. 

    Which three are valid declarations of a char?
    1. char c1 = 064770;
    2. char c2 = 'face';
    3. char c3 = 0xbeef;
    4. char c4 = \u0022;
    5. char c5 = '\iface';
    6. char c6 = '\uface';

    • 1,2,4

    • 1,3,6

    • 3,5

    • 5 only

    Correct Answer
    A. 1,3,6
  • 47. 

    Sherlock, A detective who was mere days from cracking an international smuggling ring has suddenly gone missing. While inspecting his last-known location, you find a note: 710 57735 34 5508 51 7718 Currently there are 3 suspects: Bill, John, and Todd. Can you break the detective's code and find the criminal's name?

    • Bill

    • John

    • Todd

    • Sherlock

    • None of these

    Correct Answer
    A. Bill
    Explanation
    The note contains a series of numbers. By looking closely, we can see that each number corresponds to the number of letters in each word of the suspects' names. The numbers 710 correspond to "Bill", which matches one of the suspects. Therefore, the criminal's name is Bill.

    Rate this question:

  • 48. 

    Which four options describe the correct default values for array elements of the types indicated?
    1. int -> 0
    2. String -> "null"
    3. Dog -> null
    4. char -> '\u0000'
    5. float -> 0.0f
    6. boolean -> true

    • 1,2,3,4

    • 1,3,4,5

    • 2,4,5,6

    • 3,4,5,6

    Correct Answer
    A. 1,3,4,5
    Explanation
    The correct default values for array elements of the given types are as follows:

    1. For int, the default value is 0.
    3. For String, the default value is "null".
    4. For Dog (a reference type), the default value is null.
    5. For char, the default value is '\u0000' (null character).
    Therefore, the correct options that describe the default values for array elements of the indicated types are 1, 3, 4, and 5.

    Rate this question:

  • 49. 

    Public void test(int x) {     int odd = 1;     if(odd) /* Line 4 */     {         System.out.println("odd");     }     else     {         System.out.println("even");     } } Which statement is true?

    • Compilation fails

    • "odd" will always be output.

    • "even" will always be output.

    • "odd" will be output for odd values of x, and "even" for even values.

    Correct Answer
    A. Compilation fails
    Explanation
    The compilation fails because the if statement on line 4 requires a boolean expression inside the parentheses. However, the variable "odd" is an integer, not a boolean. To fix this, the if statement should be written as "if(odd != 0)" to check if the value of "odd" is not equal to zero.

    Rate this question:

Quiz Review Timeline (Updated): May 29, 2024 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • May 29, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • May 23, 2014
    Quiz Created by
    Deepeshkankaria
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.