Aspirant Academy

MCQ

Paper - II (v) — Programming Fundamentals MCQ - Practice Questions with Answers

Solve 57 Paper - II (v) — Programming Fundamentals questions for RAS/RPSC preparation.

Practice questions

Q1Which option correctly combines a blockchain property with an advantage of an Integrated Development Environment?

A A blockchain stores only source code files, and an IDE is used only for drawing flowcharts
B A blockchain links validated blocks cryptographically, and an IDE integrates editing, running, and debugging tools
C A blockchain is a single-user spreadsheet, and an IDE removes the need to debug programs
D A blockchain requires a central database administrator, and an IDE is a replacement for all programming languages
Explanation

A blockchain is tested as a distributed ledger concept: transactions are grouped into blocks and linked in a tamper-evident way. An Integrated Development Environment is tested separately as a productivity tool because it combines editor support, build or run actions, and debugging assistance in one workspace.

Q2In Java, a class declaration uses the keyword implements with an interface name. What is the main implication of this declaration?

A The class is allowed to skip every method mentioned in the interface.
B The class promises to provide the behavior specified by the interface contract.
C The source file can be executed without compilation.
D The interface automatically becomes the only superclass of the class.
Explanation

A Java interface is a contract for behavior. When a class declares that it implements an interface, the compiler expects the class to supply the methods required by that interface unless the class itself is abstract.

Q3In Java, which keyword is used in a class declaration to inherit from another class?

A extends
B imports
C implements
D inherits
Explanation

Java uses the keyword extends when a class is declared as a subclass of another class. For example, a declaration such as class Child extends Parent establishes that Child inherits accessible members from Parent.

Q4In a basic C program, which header file is normally included when the program uses printf() and scanf() for standard input and output?

A <stdio.h>
B <math.h>
C <stdlib.h>
D <string.h>
Explanation

In C, printf() and scanf() are standard library functions associated with formatted output and input. Their declarations are supplied through <stdio.h>, so including this header allows the compiler to check calls to these functions properly.

Q5In C programming, a variable declared as static inside a function is used to count how many times that function has been called. Which statement correctly describes such a variable?

A It becomes visible to every source file of the program.
B It retains its stored value between successive calls of the same function.
C It is re-created and initialized every time the function is entered.
D It must be stored only in CPU registers.
Explanation

A static local variable in C differs from an ordinary local variable mainly in storage duration. Its name is usable only within the block where it is declared, but the object is not destroyed when the function call ends. Therefore it is suitable for preserving a counter across repeated calls of the function.

You've seen 5 of 57 sample questions

Unlimited practice on Paper - II (v) — Programming Fundamentals comes with the RAS Test Series + Practice pack or Gate Pass.

More questions

6In a C program, which loop is most suitable when the loop body must execute at least once before the condition is tested?

Afor loop
Bdo-while loop
Cwhile loop
Dnested if statement

7Which description most accurately captures machine learning at an introductory level?

AWriting every decision as a fixed if-else rule by hand
BStoring only encrypted transactions in linked blocks
CConverting source code into object code through a compiler
DUsing algorithms that learn patterns from training data to make inferences on new data

8In the .NET platform, what is the role of the Common Language Runtime?

AIt is a database engine used only for storing web-application tables.
BIt executes managed code and provides services such as memory management, type safety and exception handling.
CIt replaces all programming languages with HTML and CSS.
DIt is a text editor that formats source code but never executes programs.

9Which feature is a practical advantage of using an Integrated Development Environment for a beginner writing C, Java, or Python programs?

AIt guarantees that every program written by the learner is logically correct.
BIt removes the need to understand variables, loops, and functions.
CIt converts any programming language automatically into every other language.
DIt combines tools such as editor, build support, debugging, and error assistance in one workspace.

10A beginner is asked to design a program before coding. Which sequence follows a sound programming technique?

AWrite random code, ignore testing, then decide the input format later
BChoose variable names after deployment and skip algorithm design
CUnderstand the problem, prepare an algorithm or flowchart, code, test and debug
DStart with syntax memorisation only and avoid tracing sample cases

11In Java, which keyword is used in a class declaration to inherit from a superclass?

Ainstanceof
Bimports
Cimplements
Dextends

12Which Python data type is most appropriate when a program must store unique roll numbers and quickly test whether a roll number is already present?

AA tuple, because it allows fast insertion after creation
BA string, because it stores only one character at a time
CA list, because it automatically rejects duplicate values
DA set, because it stores distinct elements and supports membership testing

13In object-oriented programming, which pair best represents encapsulation?

AUsing many unrelated global variables for faster access
BConverting source code directly into machine code before execution
CBundling data with methods and controlling access to object state
DRepeating the same code block wherever a task is needed

14In Python, which comparison between a list and a tuple is correct?

AA list can store only numbers, while a tuple can store only strings
BA list is mutable, while a tuple is generally used as an immutable sequence
CA tuple supports item assignment, while a list never supports item assignment
DA tuple is a mapping type, while a list is a key-value collection

15In C programming, which statement best describes why a function prototype is normally written before calling a user-defined function?

AIt converts the program from source code directly into machine code.
BIt allocates heap memory for all local variables used inside the function.
CIt tells the compiler the function name, return type, and parameter types before the call is checked.
DIt prevents the function from being called more than once in the same program.

More topics in Data Processing & Programming (Basic CI)

Explore other subjects