Free CPP Programming Languages & Frameworks Questions and Answers — Questions and Answers
Question 1: Which of the following is an object-oriented programming language?
- Python (Correct answer)
- C
- Assembly
- Fortran
Correct answer: Python
Python is an object-oriented programming (OOP) language because it supports core OOP concepts such as classes, objects, inheritance, polymorphism, and encapsulation. Developers can define custom data types and their behaviors, making code modular and reusable. In contrast, C, Assembly, and Fortran are primarily procedural or low-level languages without native OOP paradigms.
Question 2: What is the purpose of a compiler in programming?
- To convert source code into machine code (Correct answer)
- To check for syntax errors
- To execute the code
- To manage memory allocation
Correct answer: To convert source code into machine code
The primary purpose of a compiler is to translate human-readable source code, written in a high-level programming language, into machine code. This machine code is a low-level language directly executable by the computer's central processing unit (CPU). This conversion is essential for creating standalone executable programs.
Question 3: Which of the following is a framework used for building mobile applications?
- Flutter (Correct answer)
- Django
- Ruby on Rails
- Spring Boot
Correct answer: Flutter
Flutter is an open-source UI software development kit created by Google, specifically designed for building natively compiled applications for mobile, web, and desktop from a single codebase. It provides a complete framework for developing cross-platform mobile applications. Django, Ruby on Rails, and Spring Boot are frameworks primarily used for web backend development.
Question 4: What is the difference between a framework and a library?
- A framework calls the code written by the developer, while a library is called by the developer (Correct answer)
- A library is always larger than a framework
- A framework only works in one programming language
- A framework is free to use, but libraries are not
Correct answer: A framework calls the code written by the developer, while a library is called by the developer
The key difference lies in the 'Inversion of Control' principle: a framework dictates the application's flow and calls the developer's code at specific points. Conversely, a library is a collection of functions or modules that the developer explicitly calls and integrates into their application as needed. Frameworks provide a complete structure, while libraries offer specific functionalities.
Question 5: Which programming language is primarily used for web development?
- JavaScript (Correct answer)
- C++
- Java
- Rust
Correct answer: JavaScript
JavaScript is the foundational and most widely used programming language for web development, particularly for client-side scripting. It enables interactive and dynamic content on web pages that run directly in web browsers. With Node.js, JavaScript can also be used for server-side development, making it a full-stack web language.
Question 6: Which of the following is a feature of the Python programming language?
- Dynamic typing (Correct answer)
- Low-level language
- Compulsory type declaration
- Used only for web development
Correct answer: Dynamic typing
Python is a dynamically typed language, meaning that variable types are inferred at runtime, and explicit type declarations are not required. This allows for greater flexibility and faster development compared to statically typed languages. It is also a high-level language, not low-level, and its use extends far beyond just web development.
Question 7: What is a common use of the C programming language?
- System programming (Correct answer)
- Mobile app development
- Web design
- Data science
Correct answer: System programming
C is a powerful, low-level programming language widely used for system programming due to its efficiency and direct memory access capabilities. It is commonly employed in developing operating systems, embedded systems, device drivers, and performance-critical applications. While versatile, its primary strength lies in interacting closely with hardware.
Question 8: What does the term 'API' stand for?
- Application Programming Interface (Correct answer)
- Automated Process Integration
- Accessible Public Internet
- Advanced Programming Interaction
Correct answer: Application Programming Interface
API stands for Application Programming Interface. It is a set of defined rules, protocols, and tools for building software applications. An API specifies how software components should interact, allowing different applications to communicate and share data without needing to understand each other's internal implementation details.
Question 9: Which of the following is a framework used for back-end web development in JavaScript?
- Node.js (Correct answer)
- Angular
- Vue.js
- Django
Correct answer: Node.js
Node.js is a JavaScript runtime environment that allows developers to execute JavaScript code outside of a web browser, making it suitable for server-side (backend) web development. It provides a robust platform for building scalable network applications. Angular and Vue.js are primarily front-end JavaScript frameworks, while Django is a Python framework.
Which of the following is an object-oriented programming language?