Q.1 Which of the following is a scripting language?
C
C++
Python
Java
Explanation - Python is an interpreted scripting language, while C, C++, and Java are compiled languages.
Correct answer is: Python
Q.2 In scripting languages, code is usually:
Compiled into machine code
Interpreted line by line
Converted into bytecode only
Executed by the OS kernel directly
Explanation - Scripting languages are typically interpreted line by line rather than compiled to machine code.
Correct answer is: Interpreted line by line
Q.3 Which of the following is NOT commonly used as a scripting language?
Perl
Ruby
JavaScript
C#
Explanation - C# is a compiled programming language, not typically used as a scripting language.
Correct answer is: C#
Q.4 JavaScript is mainly used for:
System programming
Web development
Operating systems
Device drivers
Explanation - JavaScript is widely used for web development, especially client-side scripting in browsers.
Correct answer is: Web development
Q.5 In Python, which symbol is used for comments?
//
#
/* */
--
Explanation - Python uses '#' for single-line comments.
Correct answer is: #
Q.6 Which scripting language is often embedded in HTML?
JavaScript
C++
Java
Swift
Explanation - JavaScript is the scripting language embedded in HTML for interactive web pages.
Correct answer is: JavaScript
Q.7 What does PHP stand for?
Private Home Page
Personal Hypertext Processor
PHP: Hypertext Preprocessor
Programming Hypertext Page
Explanation - PHP is a recursive acronym for 'PHP: Hypertext Preprocessor'.
Correct answer is: PHP: Hypertext Preprocessor
Q.8 Which scripting language is commonly used for server-side web development?
JavaScript
Python
PHP
All of the above
Explanation - JavaScript (Node.js), Python (Django/Flask), and PHP are widely used for server-side scripting.
Correct answer is: All of the above
Q.9 In shell scripting, which symbol is used to represent variables?
$
&
%
#
Explanation - In shell scripting, variables are referenced with a '$' symbol.
Correct answer is: $
Q.10 Which of the following is a feature of scripting languages?
Static typing
Rapid prototyping
Complex compilation
Direct hardware access
Explanation - Scripting languages support rapid prototyping due to their simplicity and interpreted execution.
Correct answer is: Rapid prototyping
Q.11 Which language is often called the 'glue language'?
Python
Perl
Ruby
Java
Explanation - Perl is often called a 'glue language' for its ability to integrate different systems.
Correct answer is: Perl
Q.12 Which scripting language is primarily used in statistical computing?
Python
R
Ruby
PHP
Explanation - R is a scripting language specialized for statistical computing and data visualization.
Correct answer is: R
Q.13 Which of these is NOT an interpreted language?
Python
JavaScript
C
Ruby
Explanation - C is compiled, not interpreted, unlike scripting languages such as Python, JavaScript, and Ruby.
Correct answer is: C
Q.14 Which scripting language is commonly used for automation in system administration?
Python
Perl
Bash
All of the above
Explanation - Python, Perl, and Bash are all widely used for automation and system administration tasks.
Correct answer is: All of the above
Q.15 What is the default extension for a Python script file?
.java
.py
.php
.js
Explanation - Python script files typically have the '.py' extension.
Correct answer is: .py
Q.16 In JavaScript, which keyword is used to declare a variable?
int
var
dim
let
Explanation - JavaScript uses 'var', 'let', or 'const' to declare variables. The traditional keyword is 'var'.
Correct answer is: var
Q.17 Which scripting language was designed for text processing?
Python
Perl
PHP
Ruby
Explanation - Perl was initially developed for text processing and remains strong in that area.
Correct answer is: Perl
Q.18 Which scripting language is mainly used with Hadoop for data processing?
Pig Latin
Python
Ruby
Perl
Explanation - Pig Latin is a scripting language used with Apache Pig for data analysis on Hadoop.
Correct answer is: Pig Latin
Q.19 What is the main advantage of scripting languages?
Faster execution speed
Ease of use and flexibility
Direct OS kernel control
Strong type checking
Explanation - Scripting languages are easy to use and flexible, but generally slower than compiled languages.
Correct answer is: Ease of use and flexibility
Q.20 Which extension is used for JavaScript files?
.java
.js
.jsx
.jsc
Explanation - JavaScript files usually have the '.js' extension.
Correct answer is: .js
Q.21 Which scripting language is commonly used with databases in web applications?
PHP
Python
JavaScript
All of the above
Explanation - PHP, Python, and JavaScript are commonly used to interact with databases in web development.
Correct answer is: All of the above
Q.22 In Python, what is the output of print(type(3.0))?
int
float
double
number
Explanation - In Python, 3.0 is treated as a floating-point number, so the type is 'float'.
Correct answer is: float
Q.23 Which scripting language is known for its use in AI and machine learning?
JavaScript
Python
PHP
Perl
Explanation - Python is widely used in AI and machine learning because of its libraries like TensorFlow and PyTorch.
Correct answer is: Python
Q.24 In Bash scripting, which command is used to display text?
print()
echo
display
output
Explanation - 'echo' is used in Bash to print text or variables to the terminal.
Correct answer is: echo
Q.25 Which of these scripting languages is primarily used for front-end development?
Python
JavaScript
PHP
Perl
Explanation - JavaScript is the primary scripting language used for front-end (client-side) web development.
Correct answer is: JavaScript
