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
-
Microsoft
-
HP
-
Intel
-
Borland
A,B,C
Correct answer
Explanation
When C# was submitted as an ECMA standard in 2000, it was co-sponsored by Microsoft (the creator), HP, and Intel. These companies jointly submitted the specifications to ECMA International for standardization. Borland was not a co-sponsor of the initial C# specification.
-
Thread.GetData
-
Monitor.Pulse
-
Thread.SpinWait
-
Monitor.Wait
B
Correct answer
Explanation
Monitor.Pulse notifies a single waiting thread in the waiting queue that the locked object's state has changed. The waiting thread can then re-acquire the lock and proceed. Thread.GetData retrieves thread-local data, Thread.SpinWait is a busy-wait mechanism, and Monitor.Wait releases the lock and puts the thread in the waiting queue.
-
Value
-
Default
-
Object
-
Param
A
Correct answer
Explanation
In C# and VB.NET, the implicit parameter name in a property setter is 'value'. When you write set { _field = value; }, 'value' automatically contains the value being assigned to the property. This is a language-defined implicit parameter name that you don't declare - it's available by default within the set accessor.
-
SortedList
-
ArrayList
-
ListDictionary
-
HashTable
D
Correct answer
Explanation
HashTable is the .NET collection class designed specifically for storing and retrieving elements using unique key-value pairs. Unlike ArrayList which uses integer indices, HashTable allows you to access any value directly by its unique key, providing fast lookups through hashing. SortedList also supports key access but maintains sorted order, while ListDictionary is optimized for small collections.
B
Correct answer
Explanation
MRTG (Multi Router Traffic Grapher) was written by Tobias Oetiker using the Perl programming language. Perl was chosen for its excellent text processing capabilities and cross-platform support. This choice made MRTG portable across different UNIX variants and other operating systems. The Perl source code can be run on any system with a Perl interpreter.
-
typedef
-
multiple
-
partial
-
typeref
C
Correct answer
Explanation
In C#, the 'partial' keyword allows class, struct, or interface definitions to be split across multiple files. This is useful for separating generated code from user-written code, or for organizing large types.
-
internal
-
implicit
-
explicit
-
new
D
Correct answer
Explanation
In C#, the 'new' keyword explicitly hides a member inherited from a base class. When a derived class declares a member with the same name as a base class member, 'new' indicates intentional hiding rather than overriding.
-
RPC/encoded
-
RPC/document
-
RPC/literal
-
Document/encoded
-
Document/literal,
A,C,D,E
Correct answer
Explanation
WSDL defines five valid SOAP binding style/use combinations. Document/literal and RPC/literal are WS-I compliant and recommended. RPC/encoded was common in early SOAP but is now deprecated. Document/encoded is technically valid though rarely used. RPC/document is not a standard WSDL combination.
-
Header
-
Envelope
-
Body
-
Fault is the Root Element
-
None of the above
C
Correct answer
Explanation
According to SOAP specification, a Fault element must appear within the Body element of the SOAP message. It cannot be in Header, Envelope (the root), or be a root element itself. The Fault element carries error or fault information from the endpoint.
-
1) A SOAP message MUST NOT use the SOAP Encoding namespace
-
1) A SOAP message MUST use the SOAP Envelope namespace
-
2) A SOAP message MUST contain XML Processing Instructions
-
2) A SOAP message MUST NOT contain a DTD reference
B,D
Correct answer
Explanation
SOAP messages MUST use the SOAP Envelope namespace (xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/') as it defines the message structure. They MUST NOT contain DTD references because SOAP is designed to work with XML parsers that may not validate against DTDs. SOAP Encoding namespace is optional (used with rpc/encoded style).
-
Binary Language
-
Machine Language
-
Primary Language
-
Assembly Language
B
Correct answer
Explanation
First-generation programming languages are machine languages, which consist of binary code (0s and 1s) that can be directly executed by the CPU. Binary Language refers to the binary format itself rather than the language category. Assembly Language is second-generation, and Primary Language is not a standard classification.
-
Assembly
-
PASCAL
-
COBOL
-
BASIC
D
Correct answer
Explanation
BASIC is traditionally implemented with an interpreter, allowing for interactive programming and immediate execution of commands. Assembly language uses assemblers (not interpreters), while Pascal and COBOL are primarily compiled languages. The interpreted nature of BASIC made it popular for educational purposes and rapid prototyping.
-
Business
-
Scientific
-
Simulation
-
All of the above
A
Correct answer
Explanation
COBOL (Common Business-Oriented Language) was specifically designed for business applications, particularly for data processing tasks in finance, administration, and government sectors. It excels at handling large volumes of data with fixed record formats. It was not designed for scientific computing or simulation purposes.
-
COmmon Business Oriented Language
-
Common OBservation Official Language
-
COmputer Basic Operating Language
-
None of the above
A
Correct answer
Explanation
COBOL stands for COmmon Business Oriented Language. It was designed in 1959 by CODASYL for business data processing, emphasizing readability and ease of use in business applications, making the other options incorrect.
-
Identification Division
-
Linkage Division
-
Data Division
-
Procedure Division
B
Correct answer
Explanation
COBOL programs have four main divisions: Identification, Environment, Data, and Procedure. The Linkage Section is part of the Data Division, not a separate division. It's used for defining data passed between programs.