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

What is the difference between a compiler and an interpreter?

  1. A compiler translates the entire program into machine code before executing it, while an interpreter executes the program line by line.

  2. A compiler generates an intermediate code that is then executed by the operating system, while an interpreter directly executes the source code.

  3. A compiler is used for high-level languages, while an interpreter is used for low-level languages.

  4. A compiler is typically slower than an interpreter, but the resulting code is more efficient.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

A compiler translates the entire program into machine code before executing it, while an interpreter reads and executes the program line by line.

Multiple choice

What is the purpose of a programming language syntax in a programming language?

  1. To define the rules and conventions for writing a program in a specific programming language.

  2. To allow a program to be parsed and interpreted by a compiler or interpreter.

  3. To improve the readability and understandability of a program.

  4. All of the above.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

A programming language syntax is a set of rules and conventions for writing a program in a specific programming language. It allows a program to be parsed and interpreted by a compiler or interpreter. It also improves the readability and understandability of a program.

Multiple choice

In the interactive storytelling platform "Ink", authors create branching narratives where readers' choices influence the story's outcome. What is the name of the programming language used in Ink?

  1. C++

  2. Java

  3. Python

  4. InkScript

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

InkScript is the programming language specifically designed for creating interactive stories in the Ink platform.

Multiple choice

Which of the following is NOT a type of finite automaton?

  1. Deterministic Finite Automaton (DFA)

  2. Non-Deterministic Finite Automaton (NFA)

  3. Pushdown Automaton (PDA)

  4. Linear Bounded Automaton (LBA)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Pushdown Automata are not finite automata, as they have a stack memory that allows them to remember previous states.

Multiple choice

Which of the following is NOT a type of context-free grammar?

  1. Chomsky Normal Form (CNF)

  2. Greibach Normal Form (GNF)

  3. Regular Grammar

  4. Context-Sensitive Grammar

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Regular grammars are not context-free grammars, as they have productions that can only generate strings of a certain length.

Multiple choice

Which of the following is NOT a type of Turing machine?

  1. Deterministic Turing Machine (DTM)

  2. Non-Deterministic Turing Machine (NTM)

  3. Universal Turing Machine (UTM)

  4. Linear Bounded Automaton (LBA)

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Linear Bounded Automata are not Turing machines, as they have a limited amount of memory.

Multiple choice

Which of the following is NOT a type of language?

  1. Regular Language

  2. Context-Free Language

  3. Context-Sensitive Language

  4. Recursively Enumerable Language

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Recursively Enumerable Languages are not a type of language in the Chomsky Hierarchy.

Multiple choice

Which of the following is NOT a type of parsing?

  1. Top-Down Parsing

  2. Bottom-Up Parsing

  3. Left-to-Right Parsing

  4. Right-to-Left Parsing

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Left-to-Right Parsing is not a type of parsing, as it is not a complete parsing strategy.

Multiple choice

Which of the following is NOT a type of language technology?

  1. Machine Translation

  2. Speech Recognition

  3. Natural Language Processing

  4. Optical Character Recognition

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Optical Character Recognition (OCR) is a technology that converts scanned images of printed or handwritten text into machine-encoded text, making it searchable and editable. It is not a language technology as it does not involve the understanding or processing of language.

Multiple choice

Which programming language is commonly used for creating generative art?

  1. Python

  2. Java

  3. C++

  4. Processing

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Processing is a programming language and development environment that is specifically designed for creating visual arts. It is widely used for creating generative art due to its ease of use and powerful graphics library.

Multiple choice

Which of the following is NOT a common method used for software translation?

  1. Machine translation.

  2. Human translation.

  3. Crowdsourced translation.

  4. Automated translation.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Automated translation is not a common method used for software translation, as it often produces inaccurate and unnatural translations that require significant manual editing.

Multiple choice

Which of the following is NOT a common method used for software translation?

  1. Machine translation.

  2. Human translation.

  3. Crowdsourced translation.

  4. Automated translation.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Automated translation is not a common method used for software translation, as it often produces inaccurate and unnatural translations that require significant manual editing.

Multiple choice

Which of the following is NOT a common method used for software translation?

  1. Machine translation.

  2. Human translation.

  3. Crowdsourced translation.

  4. Automated translation.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Automated translation is not a common method used for software translation, as it often produces inaccurate and unnatural translations that require significant manual editing.

Multiple choice

Which of the following is a popular programming language for data analysis and machine learning?

  1. Python

  2. Java

  3. C++

  4. R

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Python is a widely used programming language for data analysis and machine learning due to its simplicity, rich libraries, and extensive community support.

Multiple choice

Which of the following is a widely used programming language for developing mobile applications?

  1. Java

  2. Python

  3. Swift

  4. C++

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Swift is a modern and powerful programming language developed by Apple specifically for iOS, iPadOS, macOS, tvOS, and watchOS application development.