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
Correct answer
Explanation
ColdFusion version 8 was codenamed 'Scorpio.' This is part of Adobe's tradition of using codenames for ColdFusion releases. JAVA, C, and HTML 5 don't use 'Scorpio' as a version name.
-
speed up database queries
-
encrypt passwords
-
transform XML into HTML
-
cache html pages
C
Correct answer
Explanation
XSLT (Extensible Stylesheet Language Transformations) is designed specifically for transforming XML documents into other formats, most commonly HTML for web display. It uses templates and XPath to match and convert XML structure. Options A (database), B (encryption), and D (caching) are unrelated to XSLT's purpose.
D
Correct answer
Explanation
FORTRAN is a procedural/imperative language developed for scientific computing, while F#, Erlang, and Lisp are all functional programming languages that emphasize immutability, first-class functions, and declarative programming paradigms. Functional languages treat computation as the evaluation of mathematical functions, avoiding state and mutable data.
-
web languages
-
declarative languages
-
functional languages
-
visual languages
C
Correct answer
Explanation
Dylan, Erlang, Haskell, and ML are all functional programming languages that support first-class functions, higher-order functions, and immutability. They emphasize declarative programming where computation is expressed through function composition rather than sequence of state changes.
-
a defensive programming style
-
a web framework
-
a threading library
-
a CPU design strategy
D
Correct answer
Explanation
RISC (Reduced Instruction Set Computing) is a CPU design strategy that uses a small, highly optimized set of instructions rather than a more specialized set of instructions. RISC architectures emphasize simple instructions that can execute quickly in a single cycle, improving performance through simplification rather than complexity.
-
int [] myList = {"1", "2", "3"};
-
int [] myList = (5, 8, 2);
-
int myList [] [] = {4,9,7,0};
-
int myList [] = {4, 3, 7};
D
Correct answer
Explanation
Option D shows correct Java array syntax: int myList[] = {4, 3, 7}; - this declares an int array, initializes with values. Option A is wrong because String array literals cannot be assigned to int array. Option B uses wrong syntax (parentheses instead of braces). Option C declares 2D array but provides 1D initialization.
-
Beginers All System Interconnection Circuit
-
Basic All Symbolic Instruction Code
-
Break All System Circuit
-
Beginers All Symbolic Instruction Code
A
Correct answer
Explanation
Java is considered robust due to strong memory management, garbage collection, exception handling, and type safety. These features prevent many common runtime errors.
-
Command
-
Interpreter
-
Observer
-
Iterator.
B
Correct answer
Explanation
Interpreter Pattern defines a grammar for a language and an interpreter to evaluate sentences in that language - specifically designed for parsing and translating expressions. Command encapsulates requests as objects. Observer defines one-to-many dependencies. Iterator traverses aggregates sequentially.
-
Universal Model Locator.
-
Unified Modeling Locator.
-
Unified Modeling Language.
-
Unique Modeling Language.
C
Correct answer
Explanation
UML (Unified Modeling Language) is a standard modeling language for specifying, visualizing, constructing, and documenting software systems. It provides diagrams like class diagrams, sequence diagrams, and use case diagrams to represent different aspects of software design. The "Unified" refers to the unification of earlier modeling methodologies.
-
DFHEIBLK
-
DFHAID
-
DFHBMSCA
-
DFHKEYS
B
Correct answer
Explanation
DFHAID is the CICS copybook that defines constants for attention identifier (AID) keys like PF1, ENTER, CLEAR, etc. DFHEIBLK defines the EIB structure itself. DFHBMSCA contains basic mapping support constants, and DFHKEYS is not a standard CICS copybook.
-
Var x = new Array(50);
-
Var x = new Array[50];
-
Var x = Array(50);
-
Var x = Array[50];
A
Correct answer
Explanation
In JavaScript, arrays are created using the Array constructor with parentheses: new Array(50). Option B uses square brackets which is incorrect syntax for the constructor. Option C is missing the 'new' keyword. Option D has both errors - missing 'new' and using square brackets. The array literal syntax [50] would also be valid but isn't listed.
-
Command
-
Interpreter
-
Observer
-
Iterator.
B
Correct answer
Explanation
The Interpreter Pattern is designed to parse and evaluate sentences in a language according to a grammar. It defines a representation for the grammar and an interpreter that uses that representation to interpret sentences. Command encapsulates requests, Observer defines notification updates, and Iterator traverses collections - none handle parsing and translation like Interpreter.
-
provides syntax for describing a software architecture
-
helps design the language in which the software should be built
-
codes the architecture into desired programming language
-
describes how to design the software in a specified language
A
Correct answer
Explanation
An Architectural Description Language (ADL) provides formal syntax and semantics for describing software architectures - components, connectors, and configurations. ADLs do NOT design programming languages (that's language design), do NOT code implementations (that's programming languages), and do NOT prescribe design methodology. They are modeling languages for architectural specification and analysis.
-
Debugging
-
Coding
-
Testing and Development
-
Algorithm Documentation
B
Correct answer
Explanation
Coding is the step in the Program Development Life Cycle (PDLC) where the algorithm is translated into actual programming language code. This is the implementation phase. Debugging comes after coding, Testing and Development is broader, and Algorithm Documentation involves writing explanations.