Quick Refresher Q/A: Programming Basics

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)

  1. 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.
  2. 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. 
  3. 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. 
  4. 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)

  1. A program is a statement, that the computer executes.
  2. A program is a set of the statements, that the computer executes.
  3. A program may contain zero or more statements.
  4. A program must contain at least one statement.

Answer - 2 & 4

Question 3. What do you mean by a “programming statement”?

  1. A statement is a program in itself.
  2. A statement is an instruction or a command to the computer to do something.
  3. A statement is a comment.
  4. None of the above.

Answer - 2

Question 4. How many bits does a “nibble” contain and how many nibbles does a “byte” contain?

  1. A nibble contains 2 bits and a byte contains 2 nibbles.
  2. A nibble contains 2 bits and a byte contains 4 nibbles.
  3. A nibble contains 4 bits and a byte contains 2 nibbles.
  4. A nibble and byte are unrelated.

Answer - 3

Question 5. In any program, when you declare a variable ‘x’, what does ‘x’ signify?

  1. x contains an address.
  2. x signifies nothing.
  3. x is the name given to the memory allocated by the runtime to hold the data.
  4. None of the above.

Answer - 3

Question 6. Which of the following is true about a variable? (more than one can be correct)

  1. A variable can contain the data.
  2. A variable can only contain the data.
  3. A variable can contain an address.
  4. A variable cannot contain an address.

Answer - 1 & 3

Question 7. What is a pointer?

  1. A pointer is the name given to the memory, allocated by the runtime to hold the data.
  2. A pointer contains user data.
  3. A pointer is a variable, which contains a memory address as its data.
  4. 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)

  1. Scope means that the variable will be visible outside the program or the code block in which it is declared.
  2. Scope means that the variable will not be visible outside the code block in which it is declared.
  3. Once a variable goes out of the scope, it remains in the memory till the program is terminated.
  4. 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)

  1. A function is strictly a program.
  2. A function is a named block of the code, which can be executed (called),   whenever required.
  3. A function may or may not return a value.
  4. A function must always return a value.

Answer - 2 & 4

Question 10. What is meant by “passing a variable by reference”?

  1. It means passing a copy of the variable to the calling function or the method.
  2. It means passing the address of the variable to the calling function or the method.
  3. It means creating a new variable, using this variable and then passing the new variable.
  4. None of the above.

Answer - 2

Question 11. What is the difference between the logical ‘AND’ and bit-wise ‘AND’ operators?

  1. They are the same.
  2. 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.
  3. 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.
  4. None of the above.

Answer - 3

Question 12. Which of the following type of class allow only one object to be created?

  1. Friend Class.
  2. Singleton Class.
  3. Abstract Class.
  4. None of the above.

Answer - 2

Question 13. Which of the following concepts determines at the runtime and is a method to invoke?

  1. Polymorphism.
  2. Data Hiding.
  3. Dynamic Loading.
  4. Dynamic Binding.

Answer - 4

Question 14. A computer system that permits the multiple users to run the programs at the same time is called?

  1. Multi-tasking System.
  2. Real time System.
  3. Time Sharing System.
  4. Multi-programming System.

Answer - 1

Question 15. SQL stands for.

  1. Simple Querying Language.
  2. Structured Querying Language.
  3. Simplified Query Language.
  4. Structured Query Language.
Answer - 4


Similar Articles