Home / Rakesh Kumar / Programming MCQs Solution

Programming Portal Solution

You will find all Programming Portal MCQs whose solution is updated by Rakesh Kumar

Q. What is the result of the following code snippet? try { int[] arr = new int[5]; int value = arr[10]; } catch (ArrayIndexOutOfBoundsException e) { System.out.println("Exception Caught!"); } finally { System.out.println("Finally Block!"); }

Q. What will be the output? class MyClass{ public String test(){ try{ System.out.print("One"); return ""; } finally{ System.out.print("Two"); } } } public cla

Q. Which of these class is related to all the exceptions that are explicitly thrown?

Q. What is the result of compiling and running this program? class Mammal{ void eat(Mammal m){ System.out.println("Mammal eats food"); } } class Cattle extends Mammal{ void eat(Cattle c){ System.out.println("Cattle eats hay"); } } clas

Q. Which of these is not abstract?

Q. Which of these interface is not a member of java.io package?

Q. What will be the output of the following Java program? import java.io.*; class Chararrayinput { public static void main(String[] args) { String obj = "abcdef"; int length = obj.length(); char c[] = new char[length]; obj.getChars(0, length, c, 0);

Q. What will be the output of the following Java program? class X { int a; double b; } class Y extends X { int c; } class Output { public static void main(String args[]) { X a = new X(); Y b = new Y(); Class obj; obj = b.getClass(); System.out.

Q. Determine output of the following code. interface A { } class C { } class D extends C { } class B extends D implements A { } public class Test extends Thread{ public static void main(String[] args){ B b = new B(); if (b instanceof A)

Q. Which of the following is an incorrect statement about packages?

Q. What does System.getProperty("variable") return?

Q. What will be the output of the following Java code? class Output { public static void main(String args[]) { double x = 3.14; int y = (int) Math.ceil(x); System.out.print(y); } }

Q. Which of these is a wrapper for simple data type float?

Q. What will be the output of the following Java program? class exception_handling { static void throwexception() throws ArithmeticException { System.out.print("0"); throw new ArithmeticException ("Exception"); } publ

Q. What will be the output of the following Java program? class Output { public static void main(String args[]) { double x = 3.1; double y = 4.5; double z = Math.max( x, y ); System.out.print(z); } }

Q. Which of the following is true about Java system properties?

Q. In Java, can a subclass override a private method from its superclass?

Q. In method overriding, which keyword is used in the child class to indicate that a method is intended to override a superclass method?

Q. In method overloading, can methods have the same name and the same return type if their parameter types are different?

Q. What is the result of the following code snippet? class Parent { void display() { System.out.println("Parent"); } } class Child extends Parent { void display() { System.out.println("Child"); } } public class Main { public static void main(String[] args) { Parent obj = new Parent

Q. In Java, can a subclass overload a method from its superclass?

Q. What will be the return type of a method that not returns any value?

Q. The following code contains one compilation error, find it? public class Test { Test() { } // line 1 static void Test() { this(); } // line 2 public static void main(String[] args) { // line 3 Test(); // line 4 } }

Q. What is the result of the expression 3 << 2 in Java?

Q. int x = 0, y = 0 , z = 0 ; x = (++x + y-- ) * z++; What will be the value of "x" after execution ?

Q. What will be the output of the following Java program?

Q. Which of the following is not a valid jump statement?

Q. What will be the output of the following Java program?

Q. In Java, what is the purpose of the endsWith() method of a String object?

Q. How many objects will be created? String a = new String("Examveda"); String b = new String("Examveda"); String c = "Examveda"; String d = "Examveda";

Q. What will be the output of the following Java program?

Q. The output of the following fraction of code is public class Test{ public static void main(String args[]){ String s1 = new String("Hello"); String s2 = new String("Hellow"); System.out.println(s1 = s2); } }

Q. What is the value returned by function compareTo() if the invoking string is less than the string compared?

Q. Which of these method of class String is used to compare two String objects for their equality?

Q. What will be the output of the following Java code? class array_output { public static void main(String args[]) { int array_variable[][] = {{ 1, 2, 3}, { 4 , 5, 6}, { 7, 8, 9}}; int sum = 0; for (int i = 0; i < 3; ++i) for (int j = 0; j < 3 ; ++j)

Q. Consider the following two classes declared and defined in two different packages, what can be added in class B to form what considered a correct access to class A from main() method of class B? package subPackage; public class A { } package anotherPackage; // line 1 public class B{ public stat

Q. What is the size of a long variable in Java?

Q. What is the minimum value that can be stored in a char variable in Java?

Q. Which of the following is not a valid way to declare a char variable in Java?

Q. What is the output of the following program? class A{ public static void main(String args[]){ byte b; int i = 258; double d = 325.59; b = (byte) i; System.out.print(b); i = (int) d; System.out.print(i); b =

Q. What is the output for the below code? class A{ int k; boolean istrue; static int p; public void printValue(){ System.out.print(k); System.out.print(istrue); System.out.print(p); } } public class Test{ public static void main(S

Q. Determine output: public class Test{ int a = 10; public void method(int a){ a += 1; System.out.println(++a); } public static void main(String args[]){ Test t = new Test(); t.method(3); } }

Q. What will be the error in the following Java code? byte b = 50; b = b * 50;

Q. How to convert a String to a Date object?

Q. What will be the output of the following Java program? class variable_scope { public static void main(String args[]) { int x; x = 5; { int y = 6; System.out.print(x + " " + y); } System.out.println(x + " " + y); }

Q. What is the default path to Perl in Unix?

Q. Which statement is used for updating existing information in the table?

Q. Which of these is the metadata log?

Q. The number of values returned from a stored procedure can be . . . . . . . .

Q. How many values can be returned from a given stored function?

Q. A DEFAULT value cannot be supplied to spatial types.

Q. Which mode tells the server to recognize || as the string concatenation operator?

Q. How many of these can replace ‘level’ in ‘-myisam-recover = level’? BACKUP, FORCE, QUICK

Q. The statement that views status variables by aggregating the values over all connections is . . . . . . . .

Q. What is the meaning of "HAVING" clause in Mysql?

Q. Which of these is used during MySQL setup?

Q. Which of the following MySQL statements is valid if '`sampledb`' is a database and '`tbl`' is a table in it?

Q. Which system variable when set to 1, makes all temporary tables to get stored on disk rather than in memory?

Q. What can be used as an alternative to mysqlconfig?

Q. What are CROSS JOIN and JOIN are similar to?

Q. Transactional processing requires lesser overhead due to CPU cycles and memory.

Q. mysql_init() returns a . . . . . . . .

Q. The command to move the cursor to the beginning of line in MySQL input editor is?

Q. MySQL client runs on the machine containing the databases and servers connect to the client over a network.

Q. Converting a client/server application to embedded server is simpler.

Q. Which function returns an array of row values?

Q. SBR replication is . . . . . . . .

Q. Which of these is the most general purpose language?

Q. Which data type character merges the "Check Constraint" into a data type definition?

Q. Under which option are index changes not flushed until tables close?

Q. The column attribute provides unique numbers for identification is . . . . . . . .

Q. The UNION ALL has a higher precedence than UNION DISTINCT.

Q. If a string is to be converted to a number, it is converted into a . . . . . . . .

Q. What is 'tamp' in the following MySQL command? mysql -h xyz.host.try.net -p -u tamp

Q. The language in which image processing is least simple is . . . . . . . .

Q. The general statement-issuing routine is . . . . . . . .

Q. Which character set variable indicates the character set used for storing identifiers?

Q. What will be the output of of the following SQL statement? SELECT person_id, Fname, lname FROM person;

Q. Which clause can be used to sort string values according to a specific collation?

Q. The mode used to turn off the special meaning of backslash and treat it as an ordinary character is . . . . . . . .

Q. All queries can be cached.

Q. The statement to change the table name is . . . . . . . .

Q. Which of these is also known as a virtual table?

Q. Which among the following operators is/are belongs to "Equality conditions"?

Q. What does RTF refer to?

Q. The character that the MySQL client program recognizes as a statement delimiter is . . . . . . . .

Q. Deletion of an employee from table also deletes that employee from another table. This kind of delete is called . . . . . . . .

Q. The right shift operator is . . . . . . . .

Q. Which disk data does FILES table in INFORMATION_SCHEMA store?

Q. What attempts auto recovery based on the contents of its serial log?

Q. What will be the output of the following MySQL statement? SELECT * FROM employee WHERE start_date BETWEEN ‘2007-01-01’ AND ‘2008-01-01’;

Q. Which keyword used with UNION does not retain duplicate rows?

Q. If the operands are non binary strings, LIKE compares them according to their collation.

Q. What has a higher priority? writes, reads

Q. User defined variables are session specific.

Q. A password applies globally to an account.

Q. your presentation is ready to go, but you don't know if PowerPoint is installed on the computer, you will use to present with what's the safe way

Q. Microsoft Office InterConnect is

Q. The first version of MS Office to be released for the Microsoft Windows operating system is

Q. In NiFi, what is the significance of the "Wait" processor?

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

Q. What is the primary purpose of NiFi's "PutKafka" processor?

Q. What is the primary purpose of the "ListenHTTP" processor in Apache NiFi?

Q. In NiFi, what is the purpose of the "SplitJson" processor?

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

Q. How does Hadoop's HDFS Access Control Lists (ACLs) differ from traditional Unix file permissions?

Q. What is the purpose of Hadoop's Ranger KMS (Key Management Service) in a secure Hadoop environment?

Q. Point out the wrong statement.

Q. Which of the following project is interface definition language for hadoop?

Q. A . . . . . . . . server and a data node should be run on one physical node.

Q. . . . . . . . . is a component on top of Spark Core.

Q. Spark powers a stack of high-level tools including Spark SQL, MLlib for . . . . . . . .

Q. . . . . . . . . property allows us to specify a custom dir location pattern for all the writes, and will interpolate each variable.

Q. . . . . . . . . includes Apache Drill as part of the Hadoop distribution.

Q. Point out the wrong statement.

Q. HCatalog maintains a cache of . . . . . . . . to talk to the metastore.

Q. DoFns provide direct access to the . . . . . . . . object that is used within a given Map or Reduce task via the getContext method.

Q. What is the purpose of the HBase Time-to-Live (TTL) feature?

Q. In Oozie, what is the purpose of the "retry-max" property in a workflow action?

Q. . . . . . . . . is an abstraction over Apache Hadoop YARN that reduces the complexity of developing distributed applications.

Q. Ambari . . . . . . . . deliver a template approach to cluster deployment.

Q. Chukwa . . . . . . . . are responsible for accepting incoming data from Agents, and storing the data.

Q. Knox integrates with prevalent identity management and . . . . . . . . systems.

Q. HDT is used for listing running Jobs on . . . . . . . . Cluster.

Q. What is the purpose of the Hive EXTERNAL keyword in a CREATE TABLE statement?

Q. Point out the wrong statement.

Q. The minimum number of row versions to keep is configured per column family via . . . . . . . .

Q. . . . . . . . . is a lossless data compression library that favors speed over compression ratio.

Q. In Hadoop, what is the role of the Hadoop DBInputFormat?

Q. . . . . . . . . support storing a copy of data at a particular instant of time.

Q. Apache Hadoop . . . . . . . . provides a persistent data structure for binary key-value pairs.

Q. In Pig, what is the purpose of the JOIN statement?

Q. What is the primary role of the Pig Latin SUM() function?

Q. What is the role of the Pig Latin CROSS statement in Apache Pig?

Q. Pig Latin statements are generally organized in one of the following ways?

Q. Point out the correct statement.

Q. In Hadoop, what is the purpose of the Hadoop ResourceManager "Dynamic Resource Pools" feature?

Q. What is the primary role of the Hadoop NameNode in the Hadoop Distributed File System (HDFS)?

Q. Which of the tab shows all the role instances that have been instantiated for this service?

Q. Which of the following is a common hadoop maintenance issue?

Q. In Sqoop, what is the purpose of the "--target-dir" option in an import command?

Q. What is the primary purpose of Sqoop in Hadoop?

Q. The java package structure has changed from com.yahoo.zookeeper* to . . . . . . . .

Q. . . . . . . . . is a Cassandra feature that optimizes the cluster consistency process.

Q. Point out the wrong statement.

Q. Point out the correct statement.

Q. Cassandra uses a protocol called . . . . . . . . to discover location and state information.

Q. In a MapReduce program, what is the purpose of the Hadoop Counter class?

Q. What is the default replication factor in HDFS?

Q. . . . . . . . . has the world's largest Hadoop cluster.

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

Q. The . . . . . . . . can also be used to distribute both jars and native libraries for use in the map and/or reduce tasks.

Q. Which Hadoop component is responsible for managing and monitoring Hadoop clusters?

Q. The queue definitions and properties such as . . . . . . . . ACLs can be changed, at runtime.

Q. Which of the following adds a configuration resource?

Q. . . . . . . . . is added for supporting writing single replica files in memory.

Q. Administrators typically define parameters as final in . . . . . . . . for values that user applications may not alter.

Q. Which of the following class provides access to configuration parameters?

Q. Point out the correct statement.

Q. The . . . . . . . . requires that paths including and leading up to the directories specified in yarn.nodemanager.local-dirs.

Q. Each access key in the interface should be . . . . . . . .

Q. To menu editor is available in . . . . . . . . button of the mouse

Q. In the following code, the body of If will execute if strFirst contains?

Q. The main Property of radio button box is . . . . . . . .

Q. The strStates and strCapitals arrays are parallel arrays. If Illinois is stored in the second element in the strStates array, where is its capital (Springfield) stored?

Q. The function of . . . . . . . . is to give a pop-up message to the user.

Q. We can determine number of elements in two-dimensional array by . . . . . . . .

Q. Specifying the number of decimal places and special characters to display in a number is called as . . . . . . . .

Q. . . . . . . . . array size can be changed at run time .

Q. A variable's . . . . . . . . indicates how long the variable stays in the computer's internal memory.

Q. What will be the output of the following Visual Basic expression?

Q. The . . . . . . . . argument in syntax of Contains method represents the sequence of arguments you are searching.

Q. . . . . . . . . is commonly used to perform an immediate action when clicked.

Q. Most common error that occur in selection structure is . . . . . . . .

Q. . . . . . . . . is insert from component , it is used to load ADO control.

Q. in . . . . . . . . , first we check the condition , if the condition is true then it execute the true statement .

Q. What will be the output of the following Visual Basic code, If the intnumber variable is 90?

Q. What output will be returned if the following Visual Basic code is executed?

Q. What happens when a procedure containing the following statements ends?

Q. Designers generally use . . . . . . . . colour for the background, and . . . . . . . . for the text.

Q. Which of the following is used to convert a number from one data type to another in visual studio?

Q. . . . . . . . . Use to store alphanumeric values. A variable length string can store approximately 4 billion characters

Q. To determine whether a string has specific sequence of characters, use . . . . . . . .

Q. Which of the following selects the Cat item, which appears third in the cboAnimal control?

Q. What will be in Msg after the following code is evaluated? If 3>6 AndAlso 7>4 then Msg="Hi" Else Msg="Bye" EndIf

Q. Using array in a program is efficient because . . . . . . . .

Q. Variables declared in a form's declaration section have . . . . . . . . scope.

Q. What will be the output of the following Visual Basic expression?

Q. Option Strict On disallows conversion of String data type to . . . . . . . . implicitly.

Q. In VB, . . . . . . . . is the function that rounds up a number to a certain number of decimal places.

Q. In R, what is the purpose of the repeat loop?

Q. What will be the output of the following R code? > x <- c("a", "b", "c", "d") > for(i in 1:4) { + ## Print out each element of 'x' + print(x[i]) + }

Q. Which are the session tracking techniques? i. URL rewriting ii. Using session object iii.Using response object iv. Using hidden fields v. Using cookies vi. Using servlet object

Q. Sessions is a part of the SessionTracking and it is for maintaining the client state at server side.

Q. Which result set generally does not show changes to the underlying database that are made while it is open. The membership, order, and column values of rows are typically fixed when the result set is created?

Q. For cross field validation or some sort of barrier to ensure state before you start a flow, we use.

Q. Navigation in traditional JSF applications is handled by:

Q. How many trAnsweraction isolation levels are defined in javA)sql.Connection interface?

Q. What will happen if two thread of the same priority are called to be processed simultaneously?

Q. URL encoding is the method of replacing all the spaces and other extra characters into their corresponding _______ Characters?

Q. What type of scriptlet code is better-suited to being factored forward into a servlet?

Q. In JSP page directive which attribute defines theMIME(Multipurpose Internet Mail Extension) type of the HTTP response?

Q. Which command is used to display disk usage in Linux?

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

Q. Which command is used to display the contents of a file in Linux?

Q. Which command is used to display the last few lines of a log file?

Q. Which command is used to add a user to a specific group in Linux?

Q. Which command is used to add a new user to the system in Linux?

Q. Which command is used to display the manual page of a command in Linux?

Q. Which command is used to change the ownership of a file?

Q. What is the default access specifier for class members in C++?

Q. Which of the following correctly initializes a C++ pointer?

Q. Which of the following statements about C++ references is true?

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

Q. Which keyword is used to define a constant variable in C++?

Q. Which of the following correctly declares a pointer in C++?

Q. Which of the following is not a valid access specifier in C++?

Q. Which data type is used to store a sequence of characters in C++?

Q. Which C++ keyword is used to define an abstract class?

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

Q. Which of the following is the correct way to define a function with multiple default arguments in C++?

Q. Which of the following statements is correct about constructors in C++?

Q. Which of the following will correctly initialize a dynamic array of integers with 10 elements?

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

Q. Which of the following is the correct way to define a function with a const pointer to a const parameter in C++?

Q. Which of the following is the correct way to define a function with a const reference parameter in C++?

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 a mutable member variable in C++?

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

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 a copy constructor 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. What is the output of the following code snippet? int arr[3] = {1, 2, 3}; cout << arr[3];

Q. What is the purpose of the 'namespace' in C++?

Q. Which of the following operators is used to access members of a class in C++?

Q. What is the output of the following Python code: print('Python'.lower())?

Q. Which Docker command can be used to list all available images on your system?

Q. Which command is used to view the Docker container's mounted volumes?

Q. Which command is used to build a Docker image from a Dockerfile?

Q. Which of the following Docker commands is used to view resource usage statistics for a container?

Q. What is the 'docker-compose.yml' file used for?

Q. Which command is used to get detailed information about a running Docker container?

Q. Which command is used to detach a container from a network?

Q. Which command is used to get the IP address of a running Docker container?

Q. How can you check the health status of a running container?

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

Q. What is Docker Hub?

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

Q. What does the 'docker exec' command do?

Q. Which of the following commands is used to start an existing Docker container?

Q. Which of the following is the default storage driver for Docker?

Q. What is the default network driver used by Docker?

Q. What command would you use to remove a Docker image?

Q. How do you start a container in the background (detached mode)?

Q. What does the 'docker run' command do?

Q. Which command stops and removes all containers defined in a Docker Compose file?

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

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

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

Q. What is a Docker image?

Q. The operator “>>” is called ‐‐‐‐‐

Q. Blanks, tabs, newlines, form feeds and comments are collectively called ‐‐‐‐‐‐‐

Q. ‐‐‐‐‐‐‐ are used for comparing two conditions or to write a compound condition.

Q. Which of the following is not a valid relational operator?

Q. When following piece of code is executed, what happens?b = 3; a = b++;

Q. Which of the following function that must contain in all C++ Programs

Q. What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero‐argument constructor?

Q. Which of the following statement is incorrect?

Q. Which of the following statements are correct for a static member function? 1. It can access only other static members of its class. 2. It can be called using the class name, instead of objects.

Q. The keyword to convert constant into variable

Q. How many default constructors per class are possible?

Q. Which among the following is not true for polymorphism?

Q. What is used to write/display to the console in C++?

Q. What does GNU stand for?

Q. How would you remove a directory that is not empty?

Q. What command is used to summarize the disk usage?

Q. You just added a new user, kara, to the system. What group is kara added to by default?

Q. What is used to search files for specified words or patterns?

Q. Which command is used to see the online manual?

Q. Which of the following modes of operation exist in vi?

Q. .............is the command used to create new directory.

Q. java.awt.Component class method getLocation() returns Point (containg x and y cordinate).What does this x and y specify

Q. The ActionListener interface is used for handling action events,For example,it's used by a

Q. For 16-bit compiler allowable range for integer constants is ______ ?

Q. Which of the following is true about pure virtual functions? 1) Their implementation is not provided in a class where they are declared. 2) If a class has a pure virtual function, then the class becomes abstract class and an instance of this class cannot be created.

Q. Which of the following is true?

Q. Which of the following is not a correct statement?

Q. Predict the output of following C++ program. #include<iostream> using namespace std; class Empty {}; int main() { cout << sizeof(Empty); return 0; }

Q. #include<iostream> using namespace std; class Point { public: Point() { cout << "Constructor called"; } }; int main() { Point t1, *t2; return 0; }

Q. Which property is shown most when upcasting is used?

Q. In which type of storage location are the vector members stored?

Q. For automatic objects, constructors and destructors are called each time the objects

Q. is used by Amazon Web Services to store copies of a virtual machine.

Q. The advantages of Ajax is

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

Q. Internet provides for remote login.

Q. Logical extension of computation migration is

Q. These cloud services are of the form of utility computing i.e. the uses these services pay-as-you-go model.

Q. Which of the following is not a cloud stakeholder?

Q. Cloud providers provide cloud services to the cloud users.

Q. short-range radio frequency communication technology for remotely storing and retrieving data using devices called tags and readers

Q. To overcome the lag in the operating speeds of the I/O device and the processor we use

Q. Which of the following software can be used to implement load balancing?

Q. Point out the correct statement

Q. Even with two-factor authentication, users may still be vulnerable to attacks.

Q. The Data-Intensive Scalable Computing(DISC) utilizes a data-center clusters to gather and maintain data.

Q. Which of the following correctly describes components roughly in their order of importance from top to down?

Q. Service exporters that can export a bean as a remote service based on the :-

Q. All cloud computing applications suffer from the inherent that is intrinsic in their WAN connectivity.

Q. Which of the following benefit is provided by the PaaS service provider?

Q. Which of the following is not provided by “Deep Web”?

Q. The Hadoop list includes the HBase database, the Apache Mahout system, and matrix operations.

Q. ________________ is the central application in the AWS portfolio.

Q. Cloud computing is an abstraction based on the notion of pooling physical resources and presenting them as a ________ resource.

Q. The advantages of Ajax is _______________

Q. Data stored in __________ domains doesn’t require maintenance of a schema.

Q. Which of the following statements about Google App Engine (GAE) is INCORRECT.

Q. In order to participate in cloud-computing, you must be using the following OS _______ .

Q. A good cloud computing network can be adjusted to provide bandwidth on demand.