Computer Knowledge
Programming Languages and Compilers
2,284 Questions
Programming languages and compilers involve the rules, syntax, and semantics used to write and execute software programs. Key areas include scripting languages, object oriented concepts, and parsing algorithms like top down parsers. Practice these computer science questions to build proficiency for technical and computer knowledge exams.
Object oriented languagesScripting languagesCompilers and parsersProgramming syntax
Programming Languages and Compilers Questions
-
C++
-
Java
-
Simula
-
None of the above
C
Correct answer
Explanation
Simula 67 was the first language to introduce key object-oriented concepts like classes, objects, inheritance, and subclasses. C++ and Java are multi-paradigm languages that also support non-OO features like primitive types, making them not 'fully' object-oriented.
-
strcpy
-
memcpy
-
both memcpy and strcpy
-
none
B
Correct answer
Explanation
memcpy is theoretically faster because it knows the exact byte count upfront and can optimize the copy accordingly. strcpy must scan for the null terminator to find the length, then copy character by character until it finds it. In the given code, msg is 12 bytes (including null terminator), so memcpy copies exactly 12 bytes directly. strcpy has to first find where the string ends, then copy. Modern compilers may optimize strcpy calls when the size is known, but theoretically memcpy is faster.
-
Code-Pega-List
-
Rule-Pega-Obj
-
pxResults
-
The same class as the returned instance
A
Correct answer
Explanation
In Pega, the Obj-List method creates a top-level clipboard page of class Code-Pega-List to hold the search results. The actual instances returned by the query are stored inside the pxResults page list embedded within this Code-Pega-List page.
-
Rule-File-Binary.
-
Rule-File-Text
-
Rule-Obj-Binary
-
Rule-Obj-Text
A
Correct answer
Explanation
Rule-File-Binary is the Pega rule type designed to store binary file content, including images like JPG, JPEG files, GIFs, and other non-text files. Rule-File-Text stores text-based files, while Rule-Obj-Binary and Rule-Obj-Text are not valid Pega rule class names for file storage purposes.
-
Process Page
-
Requestor Page
-
Thread page
-
User Pages
B
Correct answer
Explanation
The Requestor Page is a special clipboard page in Pega that maintains session-level information for each user requestor (session). It stores critical runtime information including the user's access roles and privileges, the RuleSet list (determining which rules are available to the user), and HTTP protocol parameters. Process Page, Thread Page, and User Pages are not the correct names for this system clipboard page.
-
Code-Pega-List
-
Rule-Pega-Obj
-
pxResults
-
The same class as the returned instance
A
Correct answer
Explanation
The Obj-List method creates a top-level clipboard page with class Code-Pega-List. This is a system class specifically designed to hold list results generated by the Obj-List method. Rule-Pega-Obj is for object rules, pxResults is a property name within the list page, and the class is not determined by the returned instance type.
-
possible communications bottlenecks in a program.
-
the rate of change of data values as a program executes
-
the use of data on paths through the code
-
the intrinsic complexity of the code.
C
Correct answer
Explanation
Data flow analysis (option C) studies how data is used and flows on paths through code - where variables are defined, used, and killed. It's a white-box technique that identifies potential anomalies like using variables before initialization. Option A refers to performance analysis, not data flow. Option B is incorrect - data flow doesn't study rate of change. Option D describes complexity metrics like cyclomatic complexity, which is different from data flow analysis.
-
Me.DataBindings.Add(“chkIsEmployee.Checked”, dsOrg, “Users.IsEmployee”)
-
chkIsEmployee.DataBindings.Add(“Checked”, dsOrg, “IsEmployee”)
-
chkIsEmployee.Text = “{Users.IsEmployee}” chkIsEmployee.AutoCheck = True
-
chkIsEmployee.DataBindings.Add(“Checked”, dsOrg, “Users.IsEmployee”)
D
Correct answer
Explanation
DataBinding syntax requires: control.DataBindings.Add("PropertyName", dataSource, "DataMember"). For checkbox Checked property binding to Users.IsEmployee, the correct syntax is chkIsEmployee.DataBindings.Add("Checked", dsOrg, "Users.IsEmployee").
-
Format Translator
-
Form Translator
-
File or Translator
-
Formula Translator
D
Correct answer
Explanation
FORTRAN stands for 'Formula Translator,' not Format, Form, or File Translator. It was developed in the 1950s specifically for scientific and engineering calculations that involved complex mathematical formulas. The name directly reflects its purpose: translating mathematical formulas into executable code.
-
JIT
-
Language Specific Compiler
-
MSIL
-
CTS
C
Correct answer
Explanation
MSIL (Microsoft Intermediate Language) is the key to .NET language interoperability. All .NET languages compile to MSIL, which then runs on the CLR. This allows code written in different .NET languages (C#, VB.NET, F#) to work together seamlessly. JIT converts MSIL to native code at runtime, while CTS defines common types but MSIL is the actual interoperability mechanism.
-
Portable Format Reader
-
Portable File Reader
-
Production Development Facility
-
Program Development Facility
D
Correct answer
Explanation
In the mainframe context, PDF stands for Program Development Facility. It's an IBM mainframe tool used for program development, not to be confused with the more common Portable Document Format. The mainframe PDF is an interactive development environment for creating and maintaining programs on IBM mainframe systems.
-
It produces the output Procedure B calling C
-
It produces the output Procedure C calling B
-
It produces a compilation error because procedure C requires a forward declaration
-
It produces a compilation error because procedure B requires a forward declaration.
C
Correct answer
Explanation
In PL/SQL packages, procedures must be declared before they can be called by other procedures in the same package specification or body. If procedure B calls procedure C, and C is defined after B in the package body without a forward declaration, the compiler cannot resolve the reference to C when compiling B.
-
Num variable of Myclass is initialized to 10
-
Run Time Error
-
Compiler Error
-
StackOverflow Exception
C
Correct answer
Explanation
The code has a compiler error because variable 'c' is declared without the 'Dim' keyword. In VB.NET, all variable declarations require 'Dim', 'Public', 'Private', or similar keywords. The line 'Dim c as Myclass' is missing this keyword.
-
Num variable of Myclass is initialized to 10
-
Run Time Error
-
Compiler Error
-
StackOverflow Exception
C
Correct answer
Explanation
The constructor in MyClass is declared as Private, which means it cannot be accessed from outside the class. When Test.Main tries to create an instance with 'C=New Myclass(10)', the compiler detects this accessibility violation and fails before runtime.
-
a program must always begin with a PROCEDURE statement and end with an END statement
-
PL/I instructions can be coded between positions 1 and 72
-
you have to declare each variable that you are going to use
-
a program can be composed out of different procedures
-
comment lines have to be preceded by //
A,D
Correct answer
Explanation
PL/I programs must begin with a PROCEDURE statement and end with an END statement as structural requirements. The language supports modular programming by allowing programs to be composed of multiple procedures. Claims about column limits and mandatory variable declarations are incorrect, and PL/I uses /* */ for comments, not //.