Computer Terminology
603 questions available
FILTER BY SUBTOPIC
Q221.Determine the output of the following? JavaScript code: console.log(false == 0) console.log(false === 0)
Correct Answer: C
console.log(false == 0) prints true because '==' performs type coercion, and false coerces to 0, so 0 == 0 is true. console.log(false === 0) prints false because '===' checks both value and type, and a boolean is never strictly equal to a number.
Q222.A variable starts at 0 and is incremented by +2 each time. It should not exceed 10. How many iterations are required?
Correct Answer: B
Start value = 0. Increment by +2 each time. Iterations: 1 -> 2; 2 -> 4; 3 -> 6; 4 -> 8; 5 -> 10. After 5 iterations, value reaches 10 (limit). It should not exceed 10, so we stop here. Total iterations = 5.
Q223.Which loop is used to retrieve the first true condition and then stops?
Correct Answer: D
An if statement checks a condition and executes once if it is true. It does not loop repeatedly, unlike for, while, or do-while loops. It effectively stops after the first true condition is evaluated.
Q224.Given syntax is correct but output/error shows "video can't be played". Likely cause?
Correct Answer: A
The syntax is already correct, so the issue is not in the code. Browsers support only certain formats like MP4, WebM, or OGG.
Q225.Snippet: System.out.println("Hello World")?
Correct Answer: C
System.out.println() is a Java statement used to print output to the console. C++ uses cout << "Hello World";. Python uses print("Hello World"). JavaScript uses console.log("Hello World");. This syntax is specific to Java's standard output system.
Q226.Which program/code corresponds to Pandas library in Python?
Correct Answer: A
Pandas is a Python library for data manipulation and analysis. The standard import statement is: import pandas as pd. NumPy is for numerical computations, Matplotlib is for data visualization, and Scikit-learn is for machine learning.
Q227.Which is the correct syntax to declare an array in JavaScript?
Correct Answer: B
In JavaScript, arrays are declared using square brackets [ ]. Each element inside the brackets is separated by a comma (or spaces in simplified options). Parentheses ( ), curly braces { }, and angle brackets < > are not used for arrays.
Q228.For storing large volumes of unstructured data like logs or JSON, which NoSQL database is most suitable?
Correct Answer: B
MongoDB is a NoSQL document database that stores data in JSON-like documents. It is ideal for large volumes of unstructured or semi-structured data like logs. Unlike SQL databases (MySQL, Oracle, SQL Server), it does not require a fixed schema.
Q229.Analyze the following C++ program and determine its output: int x = 5; if (x > 3) x += 2; else x -= 2; cout << x;
Correct Answer: C
The initial value of x is 5. The if condition x > 3 is true. The statement x += 2 is executed, so x becomes 7. The else block is skipped, resulting in an output of 7.
Q230.Which Python library is best for numerical computation in ML?
Correct Answer: B
NumPy is a Python library for numerical computation and array operations. It provides fast mathematical functions for large datasets. Many machine learning libraries like TensorFlow and Scikit-learn use NumPy arrays internally.
Q231.What will be the output of the following C++ code? bool b = false; cout << b + 2;
Correct Answer: C
In C++, false is evaluated as 0 in arithmetic operations. Therefore, b + 2 becomes 0 + 2 = 2.
Q232.What is the output of the following C++ code? int a = 1, b = 0; cout << (a || a && b);
Correct Answer: B
&& has higher precedence than ||. a && b evaluates first, which gives 0 (since b is 0). Then, a || 0 is evaluated, which gives 1 (since a is 1). The final output is 1.
Q233.What is the time complexity of a loop inside a loop, each running n times?
Correct Answer: C
A loop inside another loop is called a nested loop. If both loops run n times, the inner loop runs n times for each iteration of the outer loop. Total iterations = n * n = n^2, giving a time complexity of O(n^2).
Q234.In data structures, what does unshift do?
Correct Answer: A
In arrays or lists, unshift adds a new element to the start of the structure. The existing elements are shifted one position to the right to make space.
Q235.In data structures, what does shift do?
Correct Answer: A
In arrays or lists, shift removes the first element. The remaining elements are shifted one position to the left to fill the gap.
Q236.In data structures, what does push do?
Correct Answer: B
In stack or list data structures, push is used to add an element to the top of the stack or the end of the structure.
Q237.In data structures, what does pop do?
Correct Answer: B
In a stack, pop removes the element from the top (the last element added). Stacks follow the LIFO (Last In, First Out) principle.
Q238.Which command is used to list all files and directories in Linux?
Correct Answer: A
The ls command in Linux is used to list all files and directories in the current directory. cd changes directories, mkdir creates a directory, and rm deletes files.
Q239.Which sign/algorithm uses a "time quantum" to allocate CPU time to processes?
Correct Answer: B
Round Robin (RR) is a CPU scheduling algorithm that assigns each process a fixed time slice called a time quantum. It is a preemptive scheduling algorithm.
Q240.Which of the following is the Average Case Time Complexity fo the Bubble sort algorithm?
Correct Answer: A
Bubble Sort has an average and worst-case time complexity of O(n^2) due to nested passes over the array.