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
D
Correct answer
Explanation
C is most susceptible to buffer overflow because it allows direct memory manipulation through pointers, lacks automatic bounds checking on array access, and requires manual memory management. Java has built-in bounds checking and garbage collection that prevent buffer overflows. COBOL has stronger memory safety features. ColdC is not a mainstream language with known buffer overflow issues.
-
Stack-based Architecture
-
Register-based Architecture
-
Queuing Method
-
None of above
B
Correct answer
Explanation
Dalvik VM uses register-based architecture rather than stack-based architecture. Register-based machines typically have fewer instructions and better performance for embedded systems compared to stack-based VMs like the JVM.
-
Java programming language
-
C language
-
C++ language
-
Objective-C
-
None of above
B
Correct answer
Explanation
Dalvik VM is written in C language, not Java. It's a clean-room VM implementation optimized for mobile devices, designed to run on systems with limited resources like memory and battery power.
-
Compiler Language Runtime
-
Common Language Runtime
-
Common Language Running Time
-
Compiler Language Running Time
B
Correct answer
Explanation
CLR stands for Common Language Runtime, the execution environment for .NET applications. It manages memory, handles exceptions, and provides core services for running managed code. This is a fundamental .NET framework concept.
D
Correct answer
Explanation
MSIL (Microsoft Intermediate Language) is the intermediate language in .NET. When you compile .NET code, it's converted to MSIL, which is then converted to native machine code by the JIT compiler at runtime. This allows .NET code to be language-agnostic.
-
The Common Language Run-time compiles source code to MSIL code.
-
The C# and VB.NET compilers compile source code to native code
-
Code compiled in one .NET language can interact with code compiled in a different .NET language
-
The CLR does NOT implement a Common Type System
C
Correct answer
Explanation
The CLR enables language interoperability in .NET by allowing code compiled in one .NET language (like C#) to interact with code compiled in another .NET language (like VB.NET). This is possible because all .NET compilers compile to MSIL (Microsoft Intermediate Language), which the CLR executes, and the CLR implements a Common Type System (CTS) ensuring type compatibility across languages.
-
Conventional Language Runtime
-
Clarified Language Runtime
-
Common Language Runtime
-
Clear Language Runtime
C
Correct answer
Explanation
CLR stands for Common Language Runtime, which is the virtual machine component of Microsoft's .NET framework. It manages program execution and provides services like memory management, security, garbage collection, and exception handling. The 'Common' signifies that multiple languages (C#, VB.NET, F#) can all compile to IL code that runs on the same runtime. Options A, B, and D are incorrect expansions of the acronym.
-
4GL
-
4 Test Script
-
VB
-
VBScript
D
Correct answer
Explanation
QuickTest Professional (QTP), now known as Unified Functional Testing (UFT), uses VBScript as its scripting language. VBScript is a lightweight, interpreted scripting language based on Visual Basic that allows testers to write automated test scripts with programming constructs like loops, conditions, and functions.
-
Section
-
Paragraph
-
Modules
-
Division
C
Correct answer
Explanation
COBOL programs are hierarchically structured with four divisions (Identification, Environment, Data, Procedure), which contain sections, and sections contain paragraphs. 'Modules' is not a standard COBOL structural component - this term is used in other programming languages but not in COBOL's hierarchy.
-
Java
-
C++
-
Objective-C
-
Ruby
A
Correct answer
Explanation
Java has historically been the primary programming language for Android application development, supported by the official Android SDK. While C++ can be used via NDK, it's not the primary development language. Objective-C is used for iOS, not Android. Ruby is not natively supported for Android development.
A,B,C,D
Correct answer
Explanation
Java, Python, C/C++, and Scheme are all programming languages. Java and Python are widely used high-level languages, C/C++ provides low-level control, and Scheme is a functional programming language.
A
Correct answer
Explanation
PHP is a loosely typed language, meaning you don't need to declare variable types explicitly. Variables can automatically change types based on the context (e.g., a string can be used in arithmetic operations).
B
Correct answer
Explanation
Python was created by Guido van Rossum and first released in 1991. It is known as a general-purpose, very-high level programming language. C# was created by Microsoft (Anders Hejlsberg), Perl by Larry Wall, and Jython is a Python implementation for JVM (not by Guido). The name 'Von Russom' is a typo for 'van Rossum'.
-
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 that is especially suited for web development and can be embedded into HTML. The 'open source' designation means the source code is freely available for anyone to use, modify, and distribute. 'General purpose' indicates it's not limited to web-only tasks - PHP can be used for command-line scripting, GUI applications, and more. Option B incorrectly calls it proprietary (it's not owned by a single company), while options C and D incorrectly suggest it's limited to special purposes.