Top Computer Science and Programming Question Answers

  • Which is the following is not programming language?
    Ans: HTML [HyperText Markup Language] is used for structuring web page not for logical programming or computation. Programming languages like Python, Java, and C++ include logic, variables, and control structures.
  • Which data structure uses FIFO (First In First Out)?
    Ans: Queue processes elements in the order they were added — the first element added is the first one to be removed, FIFO. Stacks use LIFO (Last In First Out).
  • Which used to find and fix bugs in Java programs?
    Ans: Debugger helps identify and resolve bugs or errors in a program. The JVM (Java Virtual Machine) executes the code JDK includes tools to develop code, and JRE runs Java applications.
  • Which keyword is used to define a function in Python?
    Ans: Python uses the keyword def to define a function. Example:
    def greet():
    print(“Hello FresherJobSeva”)
  • Which is not a valid variable name in C?
    Ans: Variable names in C cannot begin with a number. They must start with a letter (A-Z, a-z) or an underscore ().
  • What is the time complexity of binary search?
    Ans: Binary search splits the list in half with each step, logarithmic time complexity. It only works on sorted arrays.
  • Which of the following sorting algorithms is fastest on average?
    Ans: Merge Sort uses divide-and-conquer strategy with average and worst-case time of O(n log n), making it faster than bubble, selection, and insertion sort in most cases.
  • Which operator is used for logical AND in C/C++?
    Ans: && is the logical AND operator used to evaluate whether both conditions are true. & is a bitwise AND operator, || is logical OR, and ! is logical NOT.

Leave a Comment