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

Multiple choice technology programming languages
  1. speed up database queries

  2. encrypt passwords

  3. transform XML into HTML

  4. cache html pages

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. F#

  2. ERLANG

  3. LISP

  4. FORTRAN

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. web languages

  2. declarative languages

  3. functional languages

  4. visual languages

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. a defensive programming style

  2. a web framework

  3. a threading library

  4. a CPU design strategy

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology architecture
  1. int [] myList = {"1", "2", "3"};

  2. int [] myList = (5, 8, 2);

  3. int myList [] [] = {4,9,7,0};

  4. int myList [] = {4, 3, 7};

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology architecture
  1. Command

  2. Interpreter

  3. Observer

  4. Iterator.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology architecture
  1. Universal Model Locator.

  2. Unified Modeling Locator.

  3. Unified Modeling Language.

  4. Unique Modeling Language.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology mainframe
  1. DFHEIBLK

  2. DFHAID

  3. DFHBMSCA

  4. DFHKEYS

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology architecture
  1. Var x = new Array(50);

  2. Var x = new Array[50];

  3. Var x = Array(50);

  4. Var x = Array[50];

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology architecture
  1. Command

  2. Interpreter

  3. Observer

  4. Iterator.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. provides syntax for describing a software architecture

  2. helps design the language in which the software should be built

  3. codes the architecture into desired programming language

  4. describes how to design the software in a specified language

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. Debugging

  2. Coding

  3. Testing and Development

  4. Algorithm Documentation

Reveal answer Fill a bubble to check yourself
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.