Computer Knowledge

Programming Fundamentals

2,611 Questions

Programming fundamentals form the core logic of software development and computer science. This includes variable declarations, pointer assignments, loop iterations, and exception handling. These technical topics are regularly tested in computer knowledge and IT officer competitive examinations.

Variables and arraysPointer assignmentsLoop iterationsException handling blocksCompile time errorsFunction references

Programming Fundamentals Questions

Multiple choice technology
  1. Rule

  2. rule instance

  3. none

  4. rule object

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Exit criteria in rule tasks define conditions that halt rule execution. Valid exit criteria include 'Rule' (exit after a specific rule) and 'rule instance' (exit after a rule instance fires). 'Rule object' is not a valid exit criterion type - it's not a standard way to define when rule execution should stop. The question correctly identifies this.

Multiple choice technology programming languages
  1. ((1 2 3 4 5 6))

  2. (1 2 3 4 5 6)

  3. ()

  4. (4 5 6 1 2 3)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

append returns a NEW list with combined elements - it does not modify the original lists. list3 remains empty because append was not assigned back to list3. The correct expression would be (set! list3 (append list3 list1 list2)).

Multiple choice technology programming languages
  1. Run time

  2. Compile time

  3. Depends on how it is invoked

  4. Both b and c

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Inline functions are expanded in place by the compiler at compile time rather than being invoked via normal function call overhead at run time. This direct expansion reduces execution overhead, making compile time the correct phase for this mechanism.

Multiple choice technology programming languages
  1. It can abort the program

  2. It can cause a failure

  3. It can cause an error

  4. It can cause a trap

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Deleting a pointer twice causes undefined behavior, often manifesting as a CPU trap when the memory manager detects the invalid operation. The program may crash or corrupt memory silently.

Multiple choice technology programming languages
  1. Static binding

  2. Dynamic binding

  3. -

  4. --

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Dynamic binding allows the program to determine which function implementation to call at runtime based on the actual object type, rather than the pointer/reference type. This enables runtime polymorphism through virtual functions.

Multiple choice technology web technology
  1. During flow execution as process conrtol advances from one task to another

  2. At the end of activity step,after invoking the method, but before any transition step

  3. Upon database commit when any object is saved to database

  4. All of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Declare rules (like Declare Expressions, Constraints, and OnChange) execute automatically. They run during flow execution, at the end of activity steps, or upon database commits depending on the rule type, making 'All of the above' correct.

Multiple choice technology web technology
  1. During flow execution as process conrtol advances from one task to another

  2. At the end of activity step,after invoking the method, but before any transition step

  3. Upon database commit when any object is saved to database

  4. All of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Declare rules in PRPC execute at multiple points: as flow processing advances between tasks, after activity step methods complete but before transitions, and when objects are committed to the database. This makes them versatile for maintaining data integrity throughout the application lifecycle.

Multiple choice technology web technology
  1. (a) They are stored on the clipboard as temporary variables

  2. (b) They exist only within the context of an activity

  3. (c) They can be stored in the database

  4. (d) They are stored in a named page that is created automatically

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Local variables in Pega are activity-specific. They exist only during the execution of that activity and are not stored persistently. They are not stored on the clipboard as temporary variables (A), cannot be stored in the database (C), and are not stored in automatically created named pages (D). Their scope is strictly limited to the activity context.

Multiple choice technology web technology
  1. (a) Do not have any connectors emanating from the Flow shape

  2. (b) In the Flow parameters, select Branch, not Call

  3. (c) You cannot use a Flow shape to branch to another flow

  4. (d) none of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

To branch to another flow without returning control, you simply do not have any connectors emanating from the Flow shape. This creates a one-way transfer - execution continues in the called flow and never returns to the original flow. The Flow parameters do not have a 'Branch' option.

Multiple choice technology web technology
  1. During flow execution as process conrtol advances from one task to another

  2. At the end of activity step,after invoking the method, but before any transition step

  3. Upon database commit when any object is saved to database

  4. All of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Declare rules in Pega (like Declare Expressions, Constraints, OnChange, and Triggers) execute automatically based on their configuration: during forward/backward chaining as control advances, after activity steps before transitions, or upon database commits.

Multiple choice technology programming languages
  1. . (dot)

  2. ,

  3. ->

  4. >

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

-> (arrow operator) is correct because it is used with pointers to access members of an object. The dot operator (A) is used with object references, commas (B) are separators, and > (D) is a comparison or stream operator. The this pointer is a pointer, so it uses -> for member access.