Home / Shiva Ram / Programming MCQs Solution

Programming Portal Solution

You will find all Programming Portal MCQs whose solution is updated by Shiva Ram

Q. In Java, can a "finally" block be used without a "try-catch" block?

Q. In Java, which type of exceptions are checked at compile-time?

Q. What will be the output of the following Java code? class Output { public static void main(String args[]) { try { int a = 0; int b = 5; int c = a / b; System.out.print("Hello"); } finally {

Q. Which part of code gets executed whether exception is caught or not?

Q. What is the concept of method overriding in Java inheritance?

Q. Determine output: class A{ public void printName(){ System.out.println("Name-A"); } } class B extends A{ public void printName(){ System.out.println("Name-B"); } } class C extends A{ public void printName(){ System

Q. Which of the following methods is a method of wrapper Integer for obtaining hash code for the invoking object?

Q. Which of the following package stores all the simple data types in java?

Q. Which of these class contains only floating point functions?

Q. Which of these is a super class of wrappers Double and Float?

Q. What will be the output of the following Java program? class Output { public static void main(String args[]) { Double i = new Double(257.5); Double x = i.MIN_VALUE; System.out.print(x); } }

Q. What is the range of numbers returned by Math.random() method?

Q. What will be the output of the following Java program? import java.util.*; class LOCALE_CLASS { public static void main(String args[]) { Locale obj = new Locale("INDIA") ; System.out.print(obj.getCountry()); } }

Q. In Java, can an interface extend another interface?

Q. What will be the output of the following Java code? class A { int x; int y; void display() { System.out.print(x + " " + y); } } class Output { public static void main(String args[]) { A obj1 = new A(); A obj2 = new A();

Q. Where is String Pool stored?

Q. What will be the output of the following Java program? import java.lang.reflect.*; class Additional_packages { public static void main(String args[]) { try { Class c = Class.forName("java.awt.Dimension"); Field fields[] = c.getFields(); for (int i = 0; i &

Q. Which of the following method of Process class can terminate a process?

Q. Can a method be both overloaded and overridden in the same class in Java?

Q. What is the purpose of the "@Override" annotation in Java?

Q. What will be the output? public class Test{ public static void main(String[] args){ String value = "abc"; changeValue(value); System.out.println(value); } public static void changeValue(String a){ a = "xyz";

Q. What is the output of the program? class MyClass{ MyClass(){ System.out.print("one"); } public void myMethod(){ this(); System.out.print("two"); } } public class TestClass{ public static void main(String args[]){

Q. Method overriding is combination of inheritance and polymorphism?

Q. What is it called where child object gets killed if parent object is killed?

Q. What will be the output of the following Java code? class box { int width; int height; int length; int volume; box() { width = 5; height = 5; length = 6; } void volume() { volume = width*height*length; } } class constru

Q. What would be behaviour if the constructor has a return type?

Q. In the following Java code, which call to sum() method is appropriate? class Output { public static int sum(int ...x) { return; } static void main(String args[]) { sum(10); sum(10,20); sum(10,20,30);

Q. Which of the following statements is correct?

Q. Determine output:

Q. String str1 = "Kolkata".replace('k', 'a'); In the above statement, the effect on string Kolkata is

Q. What will be the output of the following Java program? class output { public static void main(String args[]) { StringBuffer c = new StringBuffer("Hello"); c.delete(0,2); System.out.println(c); } }

Q. What is the string contained in s after following lines of Java code? StringBuffer s new StringBuffer("Hello"); s.deleteCharAt(0);

Q. How do you find the last index of a specified character in a string in Java?

Q. Which of the following statement is correct?

Q. Which method is used to find the length of an array in Java?

Q. Name the keyword that makes a variable belong to a class, rather than being defined for each instance of the class.

Q. Which of these can not be used for a variable name in Java?

Q. Literals in java must be appended by which of these?

Q. What will be the output of the following Java code snippet? class A { } enum Enums extends A { ABC, BCD, CDE, DEF; }

Q. How to get UTC time?

Q. Which among the following is the correct syntax for defining "ENUM" in Mysql?

Q. The function returning an array of row values is . . . . . . . .

Q. What is x in the following MySQL statement? DELETE FROM x USING x LEFT JOIN y ON x.col = y.col;

Q. Which string function returns the index of the first occurrence of substring?

Q. What will be the output of the following MySQL command? SELECT emp_id, fname, lname FROM employee WHERE title=’HEAD TELLER’ AND start_date>2008-11-23;

Q. '2341' is a . . . . . . . .

Q. Which privilege is enabled to create of alter a stored function?

Q. Which of these has a lower memory requirements? mysql_use_result(), mysql_store_result()

Q. What is the default format for "Timestamp" data type?

Q. To see the table structure which command is issued?

Q. The mode that does not remove trailing spaces when CHAR values are retrieved is . . . . . . . .

Q. What is def in the following MySQL statement? CREATE TRIGGER abc (...) (...) ON def FOR EACH ROW ghi;

Q. What is the special database that always exists after setting up MySQL on a computer?

Q. abc in the following MySQL statement is . . . . . . . . CREATE VIEW xyz (abc) AS SELECT a FROM t;

Q. Which keyword is used to specify the foreign key after the table is created?

Q. The mantissa in -1.58E5 is . . . . . . . .

Q. What is the embedded server library containing the MySQL server linkable into applications?

Q. Which Clause is used to select a particular row from the set of row in an existing table?

Q. Is "GROUP BY" clause is similar to "ORDER BY" clause?

Q. The default scheduling property of MySQL is implemented by how many of these? MyISAM, MERGE, MEMORY

Q. How do the STRICT_ALL_TABLES and STRICT_TRANS_TABLES mode values deal with bad data?

Q. The option for specifying the executable name while compiling with gcc is . . . . . . . .

Q. What will be the result of the following MySQL command? WHERE TITLE= ‘teller’ AND start_date < ’2007-01-01’

Q. The 'mysqlbackup' command to perform a restore operation is . . . . . . . .

Q. Which property determines whether a database object is a case sensitive?

Q. Replication does not enable data from one MySQL database server to be copied to one or more MySQL database servers.

Q. What is the non handle array representing a row of values?

Q. Which among the following tags belong to Data definition language?

Q. The binary protocol is easy to use.

Q. Which server mode value disables use of built in function names as identifiers?

Q. What does 'abc' & 'xyz' specify in the following SQL statement? CREATE TABLE abc (xyz);

Q. The maximum length of the char columns is . . . . . . . .

Q. Will the following SQL command produce any error? INSERT INTO person (person_id, fname,lname) VALUES (1,’S’,’U’), VALUES (1,’T’,’U’); /* where person_id is a primary key */

Q. In PHP, which operator is used to access property of an object?

Q. What does 'abc' || 'xyz', when PIPES_AS_CONCAT is enabled, result in?

Q. Which variable is used to set table alias names as non-case sensitive?

Q. Which statement is used to remove indexes on tables?

Q. Which collations does this MySQL statement list? SHOW COLLATION LIKE 'utf8%'

Q. To check how MySQL would execute a SELECT query, which statement is used?

Q. What is the TLS protocol?

Q. Hexadecimal numbers cannot be used in scientific notation.

Q. The collations this statement lists are . . . . . . . . SHOW COLLATION LIKE 'utf8%'

Q. The spatial datatype used to store a curve is . . . . . . . .

Q. The default case sensitivity of the database and table names depends on . . . . . . . .

Q. MySQL does not support the shared-memory connections on Windows.

Q. The server uses a Unix domain socket file for connections by clients to localhost.

Q. Which upgrade involves shutting down the old MySQL version and replacing the old binaries?

Q. Microsoft Visio is a

Q. It is software for creating newsletters, busi- ness cards, flyers, greeting cards or post- cards.

Q. For Database management one uses

Q. In the relationships window, what does the appearance of symbols, such as 1 and the infinity symbol, at the endpoints of a relationship line mean?

Q. In Apache NiFi, what does the term "bulletin" represent?

Q. In NiFi, what is the role of the "PutDatabaseRecord" processor?

Q. In NiFi, what is the function of the "ExecuteStreamCommand" processor?

Q. Which Hadoop component is responsible for managing user authentication and access control?

Q. What is the significance of Hadoop's Secure DataNode Communication in HDFS security?

Q. What is the purpose of Hadoop's Audit Logging?

Q. How does Hadoop's Transparent Data Encryption (TDE) enhance security in HDFS?

Q. What is the role of Hadoop's DelegationToken in a secured Hadoop environment?

Q. . . . . . . . . represent the logical computations of your Crunch pipelines.

Q. Point out the correct statement.

Q. The Apache Crunch Java library provides a framework for writing, testing, and running . . . . . . . . pipelines.

Q. . . . . . . . . is a high performance search server built using Lucene Core.

Q. . . . . . . . . is a distributed graph processing framework on top of Spark.

Q. What is the primary role of the HBase Master Server in HBase architecture?

Q. In HBase, what is the role of the HBase Snapshots feature?

Q. In HBase, what is the purpose of the HBase Filter?

Q. In Oozie, what is the significance of the "precondition" element in a workflow action?

Q. In Oozie, what is the role of the "timeout" property in a workflow action?

Q. In Oozie, what does the term "end" represent in a workflow action?

Q. Apache Hadoop Development Tools is an effort undergoing incubation at . . . . . . . .

Q. Apache Knox Eliminates . . . . . . . . edge node risks.

Q. In Hive, what is the purpose of the SELECT statement?

Q. What is the primary function of the Hive UDAF (User Defined Aggregation Function)?

Q. Point out the wrong statement.

Q. In Hadoop, what is the purpose of the Hadoop MapFile format?

Q. The . . . . . . . . method in the ModelCountReducer class "reduces" the values the mapper collects into a derived value.

Q. The . . . . . . . . machine is a single point of failure for an HDFS cluster.

Q. What is the primary role of the Pig Latin scripting language in Apache Pig?

Q. What is the primary role of the Pig Latin ILLUSTRATE statement?

Q. . . . . . . . . is a simple xUnit framework that enables you to easily test your Pig scripts.

Q. Point out the wrong statement.

Q. In Hadoop, what is the primary role of the Hadoop ResourceManager "Preemption" feature in a Hadoop cluster?

Q. What does the term "HDFS Federation" refer to in the context of Hadoop?

Q. In Sqoop, what is the role of the "--check-column" option in an incremental import command?

Q. A . . . . . . . . server is a machine that keeps a copy of the state of the entire system and persists this information in local log files.

Q. . . . . . . . . can be configured per table for non-QUORUM consistency levels.

Q. If you set the inline LOB limit to . . . . . . . . all large objects will be placed in external storage.

Q. The compression offset map grows to . . . . . . . . GB per terabyte compressed.

Q. Point out the correct statement.

Q. What is the primary purpose of the Hadoop OutputCommitter?

Q. HBase uses the . . . . . . . . File System to store its data.

Q. . . . . . . . . can change the maximum number of cells of a column family.

Q. In Hadoop, what is the primary role of the ResourceManager in YARN?

Q. What is the purpose of the Partitioner in MapReduce?

Q. In the MapReduce model, what does the Map phase handle?

Q. What is the purpose of the MapReduce "InputFormat"?

Q. What is the significance of the MapReduce "Map" phase?

Q. . . . . . . . . is a utility which allows users to create and run jobs with any executables as the mapper and/or the reducer.

Q. . . . . . . . . is the primary interface for a user to describe a MapReduce job to the Hadoop framework for execution.

Q. What is the significance of the Hadoop Distributed File System (HDFS) in the architecture?

Q. What is the role of the Hadoop JobTracker in MapReduce?

Q. Which component of Hadoop is responsible for coordinating and scheduling tasks?

Q. In Hadoop, what is the primary function of the ResourceManager in YARN?

Q. Which component is responsible for fault tolerance in Hadoop?

Q. What is the role of the Hadoop DataNode in the architecture?

Q. What is the primary role of the ResourceManager in Hadoop YARN?

Q. What is the purpose of the Hadoop MapReduce "Combiner Optimization" in advanced MapReduce?

Q. In advanced MapReduce, what is the purpose of the Hadoop MapReduce "Map-side Aggregation" technique?

Q. What is the role of the Hadoop MapReduce "Map Output Sorting" in advanced MapReduce?

Q. What does the term "MapReduce speculative execution" refer to in advanced MapReduce?

Q. MapReduce has undergone a complete overhaul in hadoop is . . . . . . . .

Q. Point out the wrong statement.

Q. The . . . . . . . . statement is used to assign a value to a property of an object.

Q. The . . . . . . . . statement does not indicate whether a variable is passed by value or by reference.

Q. How many times will the MessageBox.Show method in the following code be processed?

Q. Which property is used to view the full image in the Picture Box?

Q. An . . . . . . . . statement is used to assign a value to an existing variable.

Q. What will the following code display in the lblAsterisks control?

Q. Which is the caption part for the following Visual Basic command?

Q. In VB, A Function procedure returns a value and a . . . . . . . . does not return a value.

Q. What is the value of len in the following Visual Basic code?

Q. The first webpage added to an application is the . . . . . . . . page.

Q. . . . . . . . . file very necessary to connect to the access data base file by ADO.

Q. An object's . . . . . . . . is used to display the type, style, and size of the font, used to display the object's text.

Q. Radio button in an interface is labeled using . . . . . . . . property.

Q. . . . . . . . . property sets the border of an image.

Q. The . . . . . . . . function temporarily converts the string to a number and then returns the number.

Q. The OptionButton control is used to selects one of the choices. its main property is . . . . . . . .value.

Q. . . . . . . . . property disables the Minimize button on the form's title bar.

Q. Variable declared in a procedure have . . . . . . . . scope.

Q. . . . . . . . . is used to delete a certain code from the code editor window.

Q. You create a Public property using a . . . . . . . . procedure.

Q. The intSales array is declared as follows: Dim intSales(,) As Integer = {{1000, 1200, 900, 500, 2000}, {350, 600, 700, 800, 100}}. The intSales(1, 3) = intSales(1, 3) + 10 statement will . . . . . . . .

Q. Which menu provides option for manipulating the control's on the form?

Q. The most common event associated with the command button is the . . . . . . . . event,

Q. What is the correct syntax to designate a default button?

Q. The . . . . . . . . allows you to abbreviate an assignment statement.

Q. . . . . . . . . is an activity that occurs during program execution such as mouse click or keystroke.

Q. The BorderStyle property of the labels that display program output is generally set to . . . . . . . .

Q. Each of the options on the submenu are referred to as . . . . . . . .

Q. When the . . . . . . . . is checked, its value is set to 1 and when it is unchecked, the value is set to 0.

Q. What does the Start Position Property determine?

Q. What is the value of len in the following Visual Basic code? Dim strVB() As String = {"Sanfoundry", "Visual Basic", "VB.Net", "Visual Studio"} Dim len As Integer len = strVB.Length()

Q. The methods which loads the form into memory . . . . . . . . it on screen.

Q. A control is locked using . . . . . . . .

Q. Designers usually include graphics to . . . . . . . . a portion of screen.

Q. A . . . . . . . . occurs while forgetting to enter an instruction, or entering the instruction in wrong order.

Q. the . . . . . . . .control is placed in the form together with six OptionButtons. To determine the shape of the shape control.

Q. . . . . . . . . splits a data frame and results an array (hence the da). Hopefully you're getting the idea here.

Q. How is a while loop different from a for loop in R?

Q. How can we define 'undefined value' in R language?

Q. In JSP how many ways are there to perform exception handling?

Q. What type of servlets use these methods doGet(), doPost(),doHead, doDelete(), doTrace()?

Q. Which methods are used to bind the objects on HttpSession instance andget the objects?

Q. What is the disadvantage of Type-4 Native-Protocol Driver?

Q. What does the 'alias' command do in Linux?

Q. Which of the following commands is used to display the list of active users in Linux?

Q. Which command is used to list files and directories in Linux?

Q. Which Linux command is used to copy files?

Q. Which Linux command is used to remove an empty directory?

Q. Which of the following correctly describes a friend function in C++?

Q. What is the size of a 'bool' data type in C++?

Q. Which of the following is the correct syntax for defining a pointer to an integer in C++?

Q. Which keyword is used to prevent a function from being overridden in derived classes?

Q. Which of the following is not a valid file operation in C++?

Q. Which function is used to read a full line of text in C++?

Q. Which of the following is used to handle exceptions in C++?

Q. Which of the following operators cannot be overloaded in C++?

Q. Which operator is used for dynamic memory allocation in C++?

Q. Which of the following is the correct way to define a function with a variable number of arguments using initializer_list in C++?

Q. Which C++ keyword is used to exit from a loop or switch statement?

Q. What does the 'sizeof' operator in C++ return?

Q. Which of the following is the correct way to declare an array of 5 integers in C++?

Q. Which of the following is the correct syntax for a for loop in C++?

Q. What is the output of the following code snippet? int x = 10; int y = 20; cout << (x <= y);

Q. What is the output of the following code snippet? int x = 10; int y = 20; cout << (x != y);

Q. Which of the following is the correct way to define an enumeration in C++?

Q. Which of the following is the correct way to define a move constructor in C++?

Q. Which of the following is the correct way to define a static member variable in C++?

Q. Which of the following is the correct way to declare a function template in C++?

Q. Which of the following is the correct way to define a class in C++?

Q. Which of the following is not a valid data type in C++?

Q. Which of the following is not a valid C++ loop?

Q. What is the purpose of the 'docker-compose config --resolve-image-digests' command?

Q. What is the purpose of the 'docker-compose config --services' command?

Q. What is the function of the 'docker pull' command?

Q. Which Docker command can be used to check the available Docker networks?

Q. Which of the following options is correct about Docker images?

Q. Which of the following is true about Docker containers?

Q. Which of the following is used to allocate a specific amount of CPU to a Docker container?

Q. Which Docker command is used to rename a container?

Q. Which of the following is a valid Docker command to start a new container?

Q. Which command is used to view the Docker version and system information?

Q. Which of the following options is used to pass environment variables to a Docker container?

Q. What is the purpose of Docker containers?

Q. Which command is used to remove a Docker network?

Q. What is a Docker 'service' in the context of Docker Swarm?

Q. Which command is used to create a Docker network?

Q. Which command is used to remove all stopped containers?

Q. What is the default command that Docker runs in a container if no command is specified?

Q. Which command is used to pull a Docker image from Docker Hub?

Q. Which command is used to list all running Docker containers?

Q. Which of the following commands creates a Docker container from an image?

Q. Which command is used to see the logs of a running Docker container?

Q. How do you scale a service in Docker Compose?

Q. How can you run Docker Compose in detached mode?

Q. Which command is used to create a Docker network?

Q. What is the purpose of the LABEL instruction in a Dockerfile?

Q. Which command is used to push an image to Docker Hub?

Q. What is the purpose of the EXPOSE instruction in a Dockerfile?

Q. Which file is used to define a Docker image build process?

Q. Which of the following is selection statement in C++?

Q. Write the range of value of the data type ‘int’

Q. A ‐‐‐‐‐‐‐‐ for an object is a request for execution of a procedure.

Q. Objects communicate with one another by using ‐‐‐‐‐‐‐‐‐‐.

Q. Within a switch statement

Q. An identifier may ‐‐‐‐‐‐‐‐

Q. Which of the following statement is correct?

Q. The function contain in the class iomanip to set width

Q. The operator we cannot use friend function

Q. Which of the following is not correct

Q. The class that is not used to create object

Q. A derived class with only one base class

Q. Destructor calls are made in which order of the corresponding constructor calls?

Q. A __________ is a constructor that either has no parameters, or if it has parameters, all the parameters have default values.

Q. Which operator is used with cin ?

Q. A base class is also known as class.

Q. Which feature in OOP is used to allocate additional function to a predefined operator in any language?

Q. What is default access specifier for data members or member functions declared within a class without any specifier, in C++?

Q. What is the purpose of the following operator? >>

Q. How do you see hidden files in your home directory?

Q. What is the full path for grub's configuration file

Q. What is the following syntax used for command 2> /dev/null

Q. Which daemon is used for the Apache server?

Q. A process is identified by a unique

Q. Which of the following runlevels will reboot the system?

Q. 27 | 8 = ?

Q. Given the code String s = new String("abc"); Which of the following call is not valid?

Q. The statement printf("%c", 100); will print?

Q. What is the output of the following program : print 'abcefd'.replace('cd', '12')

Q. Which of the following cannot be passed to a function in C++?

Q. Output of following C++ program? #include<iostream> using namespace std; int main() { int x = 10; int& ref = x; ref = 20; cout << "x = " << x << endl ; x = 30; cout << "ref = " << ref << endl; return 0; }

Q. Constructors have _____ return type.

Q. What does the sequence adaptor provide?

Q. Which operations don’t throw anything?

Q. Point out the wrong statement

Q. is a function of the particular enterprise and application in an on- premises deployment.

Q. An operating system running on a Type VM is a full virtualization.

Q. IBM’s Blue Cloud uses a special software for monitoring of virtual cluster operations and acts as a provisioning manager is known as .

Q. The advantage of I/O mapped devices to memory mapped is

Q. A is a combination load balancer and application server that is a server placed between a firewall or router.

Q. error will show if we try to send text string instead of bytes.

Q. is a CPU emulator and virtual machine monitor

Q. Cloud are standardized in order to appeal to the majority of its audience.

Q. RDS is a type of database

Q. is the degree to which nodes have a common set of connections to other nodes

Q. The Cloudlets have a ownership unlike that of Clouds.

Q. Which of the following provides commands for defining logic using conditional statements?

Q. Which of the following is an example of an unmanaged storage utility set up to do automated backups?

Q. The properties necessary to guarantee a reliable transaction in databases and other applications is referred to as

Q. From the standpoint of a it makes no sense to offer non-standard machine instances to customers.

Q. Which of the following is Type 1 Hypervisor?

Q. Point out the wrong statement.

Q. Virtualization allows sharing the resources of hardware across multiple a environments.

Q. ________ virtualization abstracts networking hardware and software into a virtual network that can be managed.

Q. HTML is considered as ___ language