Computer Knowledge
Programming Fundamentals
2,381 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
-
Evaluate variable
-
refresh variable
-
set variable
-
all the above
A
Correct answer
Explanation
In programming and scripting environments, conditions are typically evaluated using an "evaluate variable" or similar conditional evaluation mechanism. The other options like 'set variable' (assignment) and 'refresh variable' (updating value) are not primarily used for condition checking. Option D 'all the above' would be incorrect since not all listed operations are used for checking conditions.
-
indirect function is like a pointer, which returns the value of its address
-
indirect function indirectly refers the CPU memmory
-
Indirect function directly referes the CPU memmory
-
Indirect function refers the CPU and Server Memmory
A
Correct answer
Explanation
The INDIRECT function returns the value specified by a reference string, acting like a pointer to a cell address. For example, INDIRECT("A1") returns the value in cell A1. Options B, C, and D incorrectly mention CPU memory - INDIRECT works with spreadsheet cell references, not system memory.
B
Correct answer
Explanation
SAS has two line pointer controls for input data: / (forward slash) moves to the next record, and #n (like #5) moves to column n. These control where the INPUT statement reads from in the data lines. Options 1, 3, and 4 are incorrect counts.
B
Correct answer
Explanation
A const pointer (int* const) cannot be reassigned after initialization, including assignment to NULL. The const qualifier applies to the pointer itself, not the data it points to. Once initialized to an address, the pointer value is fixed.
-
Pointers
-
Friend Function
-
Access Specifiers
-
None
B
Correct answer
Explanation
A friend function in C++ is granted access to the private and protected members of a class. Because it bypasses the standard access control restrictions, it violates the core object-oriented principle of encapsulation.
D
Correct answer
Explanation
C++ structures have significant differences from C structures: they can have member functions, access specifiers (public/private/protected), constructors and destructors, support inheritance and polymorphism, and can be used as template parameters. These represent fundamental extensions beyond C's simpler struct model.
A
Correct answer
Explanation
Transparent Control Statements (TCS) in ECL indeed begin with @@. This is the defining characteristic that distinguishes them from regular ECL statements. The @@ prefix signals the ECL compiler to process these as control flow statements rather than standard code execution.
B
Correct answer
Explanation
Context-sensitive Declarative Expressions are used for embedded data, not context-free ones. Context-free expressions operate on pages and properties but don't have the context awareness needed for embedded data processing.
-
Local variables can be passed between activities
-
You cannot view local variables and their values in the tracer tool
-
You cannot view the contents of the parameter page in the clipboard viewer
-
You can view parameters and their values in the tracer tool
A
Correct answer
Explanation
Local variables are limited to the execution scope of a single activity and cannot be passed between different activities. The other statements are true: local variables cannot be traced in Tracer, and parameter pages are not visible in the clipboard viewer, making the first statement the false one.
-
Voids
-
Records
-
Vectors
-
Unions
A
Correct answer
Explanation
Voids represent the absence of a value or return type, not a compound data structure. Records, Vectors, and Unions are all compound types that can contain multiple elements or fields, while Void is a primitive/atomic concept.
-
At Compile time
-
At Run time
-
At Both compile time and run time
-
Never
B
Correct answer
Explanation
Job parameters in DataStage are set at runtime when executing a job. This allows flexibility to control job behavior dynamically without modifying the job design. Compile time is incorrect because parameter values are not fixed during compilation.
A
Correct answer
Explanation
In Ab Initio graphs, a formal parameter is a parameter defined in a graph parameter that can be overridden or overwritten by the user when the graph is executed. This allows for flexible configuration without modifying the graph itself. Actual parameters are the values passed in, while formal parameters are the placeholders that accept them.
-
Abort on first reject
-
Never abort
-
Abort on predefiend event
-
Use limit/ramp
C
Correct answer
Explanation
In Ab Initio components with reject handling (like Rollup or Join), the defined reject tolerances are 'Abort on first reject', 'Never abort', and 'Use limit/ramp'. 'Abort on predefined event' is NOT a standard reject tolerance option in Ab Initio components. Note: The option has a typo ('predefiend' instead of 'predefined'), but this doesn't change the answer - the option itself doesn't exist as a standard tolerance.
-
1001
-
error
-
Head First JavaScript
-
id
A
Correct answer
Explanation
The Book constructor function creates objects with id and name properties using 'this'. When called with 'new Book("1001", "Head First JavaScript")', it creates an object where book.id = "1001" and book.name = "Head First JavaScript". The alert(book.id) correctly outputs "1001". Option B (error) is wrong because this is valid constructor syntax.