Computer Knowledge
Programming Languages and Compilers
1,170 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
-
Output Control Work
-
Output Control Word
-
Output Common Word
-
Output Common Work
B
Correct answer
Explanation
In microprocessor and I/O systems, OCW stands for Output Control Word, which is used to control the operation of output devices or ports. The Output Control Word configures how the system interfaces with external hardware.
-
JavaScript
-
LiveScript
-
WireScript
-
ECMAScript
B
Correct answer
Explanation
JavaScript was originally named LiveScript when it was developed by Netscape. It was renamed to JavaScript as a marketing move to capitalize on Java's popularity. ECMAScript is the official standard name, not the original name. WireScript is not related.
-
For loop
-
While loop
-
Recursion
-
All of these
C
Correct answer
Explanation
For a programming language to be Turing-complete and useful, recursion (or equivalent iteration capability) is theoretically necessary. Loops are convenience features, not theoretical requirements.
-
Open source general purpose
-
Proprietary general purpose
-
Open source special purpose
-
Proprietary special purpose
A
Correct answer
Explanation
PHP is an open source, general-purpose scripting language specifically designed for web development. It can be embedded directly into HTML code, making it ideal for creating dynamic web applications. The 'open source general purpose' description accurately captures both its licensing model and its versatility beyond just web development.
B
Correct answer
Explanation
CLR (Common Language Runtime) is the correct answer because it is the runtime environment provided by the .NET Framework that manages code execution, memory management, and other services. RMT (A) is not a .NET component, JIT (C) is a compiler that works within CLR, and MSIL (D) is the intermediate language code, not the runtime environment.
A
Correct answer
Explanation
True is correct because C++ is a compiled language that converts source code directly to machine code, which the operating system can execute directly. Unlike interpreted languages or languages that compile to bytecode (like Java), C++ produces native machine code that runs without a runtime interpreter.
-
Pure C++
-
Any file type on a web server
-
Pure C#
-
Pure Java
A
Correct answer
Explanation
C and C++ allow direct memory access and lack automatic bounds checking, making them vulnerable to buffer overflows. Languages like Java and C# have built-in bounds checking and type safety that prevent buffer overflows in normal usage.
-
Compiled Language
-
Interpretive Language
-
Machine Language
-
All the above
B
Correct answer
Explanation
Perl is historically and primarily classified as an interpretive (interpreted) language, where scripts are compiled into an internal representation and executed by the Perl interpreter, rather than compiled directly to native machine code beforehand.
-
Java based
-
C++ based
-
Event based
-
C# based
C
Correct answer
Explanation
Flash (ActionScript) programming is fundamentally event-based, responding to user actions like clicks, key presses, and timeline events. While ActionScript has ECMAScript roots (like JavaScript), it is not based on Java, C++, or C#. The event-driven architecture is central to Flash interactive applications.
-
Compiled and Procedural Programming Language
-
Interpreted and Object Oriented Programming Language
-
Interpreted and Procedural Programming language
-
Compiled and Object Oriented Programming Language
B
Correct answer
Explanation
Ruby is an interpreted language, meaning code is executed directly without prior compilation, and it's purely object-oriented where everything (including numbers and booleans) is an object. This combination allows for dynamic typing and flexible programming styles.
-
Ounce
-
WebInspect
-
IBM RAD
-
None of the above
A
Correct answer
Explanation
Ounce (Ounce Labs) is a commercial static code analyzer that identifies security vulnerabilities in source code before deployment. It analyzes code paths to find potential security issues. WebInspect is a dynamic analysis tool, IBM RAD is an IDE, making Ounce the correct static analyzer choice.
-
Pure C++
-
Any file type on a web server
-
Pure C#
-
Pure Java
A
Correct answer
Explanation
Buffer overflows occur in languages that allow direct memory manipulation and lack bounds checking, like C and C++. They happen when a program writes more data to a buffer than it can hold, overflowing into adjacent memory. Java (D) and C# (C) are managed languages with automatic bounds checking that prevent buffer overflows. 'Any file type on a web server' (B) is nonsensical in this context.
-
a. JDK 1.3
-
b. JDK 1.4
-
c. JDK 5.0
-
d. JDK 6.0
A,C
Correct answer
Explanation
The question asks which JDK versions are used in IB (likely an Investment Banking system), and the correct answers are JDK 1.3 and JDK 5.0. Legacy financial systems often run on older JDK versions for stability and compatibility reasons. JDK 1.4 and 6.0 are marked as incorrect, suggesting this particular environment doesn't use those versions.
-
Division
-
Paragraph
-
Clause
-
Character
-
Program
-
All the above
F
Correct answer
Explanation
COBOL programs are hierarchically structured with multiple organizational levels. A Program contains Divisions, Divisions contain Sections, Sections contain Paragraphs, Paragraphs contain Sentences, Sentences contain Statements, and Statements contain Clauses. All these components (Division, Paragraph, Clause, Character, Program) are valid parts of COBOL structure.