Programming basics questionnaire (not specific to any technology, platform or language).
Question 1. What is the difference between a high-level language and a low-level language? Select all the correct answers (more than one can be correct)
- A high-level language is one, which is used to write a program in an assembly or machine code and a low-level language is one that is used to write a program, using a human-readable language.
- A low-level language is one, which is used to write a program in an assembly or machine code and a high-level language is one, which is used to write a program, using a human-readable language.
- A program written, using a high level language requires the use of a compiler or an interpreter, whereas one written, using a low-level language does not need it.
- A program written, using a low level language requires the use of a compiler or an interpreter, whereas one written, using a high-level language does not need it.
Answer - 2 & 3
Question 2. Which of the following is true about a computer program? (more than one can be correct)
- A program is a statement, that the computer executes.
- A program is a set of the statements, that the computer executes.
- A program may contain zero or more statements.
- A program must contain at least one statement.
Answer - 2 & 4
Question 3. What do you mean by a “programming statement”?
- A statement is a program in itself.
- A statement is an instruction or a command to the computer to do something.
- A statement is a comment.
- None of the above.
Answer - 2
Question 4. How many bits does a “nibble” contain and how many nibbles does a “byte” contain?
- A nibble contains 2 bits and a byte contains 2 nibbles.
- A nibble contains 2 bits and a byte contains 4 nibbles.
- A nibble contains 4 bits and a byte contains 2 nibbles.
- A nibble and byte are unrelated.
Answer - 3
Question 5. In any program, when you declare a variable ‘x’, what does ‘x’ signify?
- x contains an address.
- x signifies nothing.
- x is the name given to the memory allocated by the runtime to hold the data.
- None of the above.
Answer - 3
Question 6. Which of the following is true about a variable? (more than one can be correct)
- A variable can contain the data.
- A variable can only contain the data.
- A variable can contain an address.
- A variable cannot contain an address.
Answer - 1 & 3
Question 7. What is a pointer?
- A pointer is the name given to the memory, allocated by the runtime to hold the data.
- A pointer contains user data.
- A pointer is a variable, which contains a memory address as its data.
- None of the above.
Answer - 3
Question 8. Which of the following is true about the “scope of a variable”? (more than one can be correct)
- Scope means that the variable will be visible outside the program or the code block in which it is declared.
- Scope means that the variable will not be visible outside the code block in which it is declared.
- Once a variable goes out of the scope, it remains in the memory till the program is terminated.
- Once a variable goes out of the scope, it is destroyed (i.e., removed from memory).
Answer - 2 & 4
Question 9. Which of the following is true for a function? (more than one can be correct)
- A function is strictly a program.
- A function is a named block of the code, which can be executed (called), whenever required.
- A function may or may not return a value.
- A function must always return a value.
Answer - 2 & 4
Question 10. What is meant by “passing a variable by reference”?
- It means passing a copy of the variable to the calling function or the method.
- It means passing the address of the variable to the calling function or the method.
- It means creating a new variable, using this variable and then passing the new variable.
- None of the above.
Answer - 2
Question 11. What is the difference between the logical ‘AND’ and bit-wise ‘AND’ operators?
- They are the same.
- Bit-wise ‘AND’ is used for testing a true/false condition, whereas logical ‘AND’ is used to mask the value of a variable with that of the another variable.
- Logical ‘AND’ is used for testing true/false condition, whereas bit-wise ‘AND’ is used to mask the value of a variable with that of the another variable.
- None of the above.
Answer - 3
Question 12. Which of the following type of class allow only one object to be created?
- Friend Class.
- Singleton Class.
- Abstract Class.
- None of the above.
Answer - 2
Question 13. Which of the following concepts determines at the runtime and is a method to invoke?
- Polymorphism.
- Data Hiding.
- Dynamic Loading.
- Dynamic Binding.
Answer - 4
Question 14. A computer system that permits the multiple users to run the programs at the same time is called?
- Multi-tasking System.
- Real time System.
- Time Sharing System.
- Multi-programming System.
Answer - 1
Question 15. SQL stands for.
- Simple Querying Language.
- Structured Querying Language.
- Simplified Query Language.
- Structured Query Language.
Answer - 4