MySQL Questions and Answers – Choosing an API

This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Choosing an API”.

1. Which of these is the most general purpose language?
a) C
b) Perl
c) Python
d) PHP
View Answer

Answer: a
Explanation: C is a general purpose language, so in principle it can be used for anything. C tends to be used more often for standalone programs rather than for Web programming in practice.

2. Among the following, for which language is image processing least simple?
a) PHP
b) Perl
c) Python
d) C
View Answer

Answer: d
Explanation: It is not as easy to perform text processing and memory management in C than it is in languages like Perl and PHP. These capabilities tend to be heavily used in the web applications.

3. The CGI.pm module for website development is a part of _____________
a) Perl
b) Java
c) Python
d) C++
View Answer

Answer: a
Explanation: Like C, Perl is also suitable for writing standalone programs. However, Perl is quite useful for Web site development. The CGI.pm module of Perl can be extensively used for it.
advertisement
advertisement

4. Compiled programs execute faster than interpreted scripts.
a) True
b) False
View Answer

Answer: a
Explanation: For interpreted languages used in web development, the performance is better when the interpreter is invoked as a module which is a part of the Web server itself. Compiler is faster generally.

5. For a heavily used program, which of these languages should be preferred?
a) C
b) Perl
c) PHP
d) Python
View Answer

Answer: a
Explanation: C is compiled while Perl and PHP are interpreted. So C programs generally will run faster than Perl or PHP scripts. Therefore C should be the best choice for a heavily used program.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. The protocol CGI is _____________
a) computer graphics interface
b) common graphics interface
c) computer gateway interface
d) common gateway interface
View Answer

Answer: d
Explanation: The web server ‘Apache’ uses the interpreters as some CGI programs. This means that it communicates with these programs using the popular ‘Common Gateway Interface (CGI)’ protocol.

7. There is a startup penalty for a standalone interpreter.
a) True
b) False
View Answer

Answer: a
Explanation: The startup penalty for a standalone interpreter makes it give at least an order of magnitude poorer performance than the module interpreter. Interpreters also have a setup cost.
advertisement

8. Which of these has a bigger memory footprint?

Perl, PHP

a) Perl
b) PHP
c) same
d) machine dependent
View Answer

Answer: a
Explanation: A clearly significant difference between Perl and PHP is that Perl has a bigger memory footprint than PHP. Apache processes are larger with ‘mod_perl’ linked in than with ‘mod_php’.
advertisement

9. Which is the correct decreasing order for highly developed text manipulation capabilities?
a) Perl, PHP, C
b) Perl, C, PHP
c) PHP, Perl, C
d) C, PHP, Perl
View Answer

Answer: a
Explanation: Perl has the most highly developed capabilities in terms of text manipulation, and PHP follows it in the order. C is very rudimentary by comparison. It has the least simplicity.

10. Which API provides the lowest level interface to the server?
a) C API
b) Perl
c) PHP
d) Python
View Answer

Answer: a
Explanation: The C Application Programming Interface provides the lowest level interface to the server. It enforces the least policy. Therefore it provides the least amount of safety net.

Sanfoundry Global Education & Learning Series – MySQL Database.

To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.