Home › Exam guide › Chapter 3
Chapter 3: Programming Languages and Web Technology: MCQ Practice for the NEC License Exam (AItE)
This chapter contributes 10 of the 100 questions in the IT Engineering license exam. Below are its subtopics, what is usually tested, and 12 free sample questions with answers and explanations.
Start a full mock test
Subtopics in this chapter
- 3.1 Introduction to C programming
- 3.2 Pointers, structure and data files in C programming
- 3.3 OOP fundamentals and frameworks
- 3.4 Fundamentals of web technology
- 3.5 Pure virtual function and file handling
- 3.6 Generic programming and exception handling
What is usually tested
C questions test operators, control statements, functions, recursion, arrays, strings, pointers, structures versus unions, and file handling. Object-oriented questions cover constructors, access specifiers, inheritance, polymorphism, virtual functions, templates and exception handling in C++, plus Java basics such as the JVM and threads. Web questions ask about HTTP, e-mail protocols, basic HTML tags, JavaScript and the DOM, jQuery selectors and common PHP functions, sessions and database operations.
Sample questions with answers
Try each question before opening the answer. These 12 are taken from the 180 questions for this chapter in the practice bank.
1. Which of the following is NOT a storage class in C? (3.1 Introduction to C programming)
- auto
- register
- static
- volatile
Show answer
Answer: D. volatile
volatile is a type qualifier; storage classes are auto, register, static, extern.
2. The smallest individual units of a C program, such as keywords, identifiers and operators, are called: (3.1 Introduction to C programming)
- Tokens
- Statements
- Functions
- Headers
Show answer
Answer: A. Tokens
The compiler first breaks the source text into tokens: keywords, identifiers, constants, strings, operators and special symbols.
3. A pointer in C is a variable that stores: (3.2 Pointers, structure and data files in C programming)
- The memory address of another variable
- The value of another variable
- The name of another variable
- The data type of another variable
Show answer
Answer: A. The memory address of another variable
The pointer is said to point to the variable whose address it holds.
4. In C, the unary * operator applied to a pointer gives: (3.2 Pointers, structure and data files in C programming)
- The address of the pointer itself
- The value stored at the address held by the pointer
- The size of the pointer
- The data type of the pointer
Show answer
Answer: B. The value stored at the address held by the pointer
* is the indirection (dereference) operator; & is the address-of operator.
5. Bundling data and the methods that operate on it into a single unit is called: (3.3 OOP fundamentals and frameworks)
- Inheritance
- Polymorphism
- Abstraction
- Encapsulation
Show answer
Answer: D. Encapsulation
Encapsulation wraps data and methods together and hides internal details.
6. Which of the following is NOT a basic feature of object-oriented programming? (3.3 OOP fundamentals and frameworks)
- Inheritance
- Recursion
- Polymorphism
- Abstraction
Show answer
Answer: B. Recursion
The main features of OOP are encapsulation, abstraction, inheritance and polymorphism.
7. HTTP status code 404 indicates: (3.4 Fundamentals of web technology)
- Server error
- Unauthorized
- Moved Permanently
- Not Found
Show answer
Answer: D. Not Found
404 means the requested resource was not found.
8. Which HTML tag is used to create a hyperlink? (3.4 Fundamentals of web technology)
- <link>
- <a>
- <href>
- <url>
Show answer
Answer: B. <a>
The anchor tag <a> with the href attribute creates a hyperlink.
9. A virtual function in C++ is a member function that: (3.5 Pure virtual function and file handling)
- Cannot be redefined in any derived class
- Is declared in a base class and can be overridden in derived classes
- Has no access to the data members
- Is always expanded inline by the compiler
Show answer
Answer: B. Is declared in a base class and can be overridden in derived classes
The version that is called depends on the type of the object, not on the type of the pointer.
10. Dynamic (late) binding means that the function to be called is decided: (3.5 Pure virtual function and file handling)
- At link time
- At compile time
- At run time
- While the source code is being edited
Show answer
Answer: C. At run time
It happens when a virtual function is called through a base-class pointer or reference.
11. Templates in C++ support generic programming because they allow: (3.6 Generic programming and exception handling)
- Functions to be called without arguments
- Programs to run without being compiled
- One piece of code to work with many data types
- Classes to exist without member functions
Show answer
Answer: C. One piece of code to work with many data types
The data type is supplied as a parameter when the template is used.
12. Which keyword begins the declaration of a function template in C++? (3.6 Generic programming and exception handling)
- virtual
- generic
- typedef
- template
Show answer
Answer: D. template
For example: template <class T> T max(T a, T b).
Practise this chapter
The full mock tests mix 10 questions from this chapter with 10 from each of the other nine, under the real 2-hour limit. Chapter practice mode lets you work through this chapter alone, untimed, with the explanation shown after every question.
Go to the mock tests
All chapters