Explore topic-wise InterviewSolutions in Current Affairs.

This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.

1.

Reasoning:I. We can store a value in a variable using assignment operator.II. We can change the value in a variable using assignment operator.III. Assignment operator is = = (a) I and III is true (b) I and II is true (c) II and III is true (d) I, II, III is true

Answer»

(b) I and II is true

2.

Which one of the following is the most effective mental tool used for managing complexity?(a) Specification(b) Abstraction(c) Composition(d) Decomposition

Answer»

(b) Abstraction

3.

If \(\sqrt{2} \) = 1.414, and the square_root() function returns – 1.414, does it violate the following specification?1. – – square – root(x)2. – – inputs: x is a real number, x > 03. – – outputs: y is a real number such that y = x

Answer»

No, because (- 1.414)2 = 2, which satisfies input – output relation (y2 = x)

4.

Specify a function to find the minimum of two numbers.

Answer»

1. – – minimum (a,b)

2. – – inputs : a, b are real numbers.

3. – – output: result: = minimum (a,b)

5.

Initially, farmer, goat, grass, wolf = L, L, L, L and the farmer crosses the river with goat. Model the action with an assignment statement. Model of the action with an assignment statement:

Answer»

1. — farmer, goat,grass,wolf = L,L,L,L.

2. Farmer,goat: = R,R 

3. – farmer,goat,grass,wolf = R,R,L,L 

4. – farmer: = L 

5. — farmer,goat,grass,wolf = L,R,L,L 

6. farmer,grass: = R,R

7. — farmer,goat,grass,wolf = R,R,R,L 

8. farmer,goat: = L,L 

9. — farmer,goat,grass, wolf = L,L,R,L 

10. farmer, wolf: = R,R 

11. — farmer,goat,grass, wolf = R,L,R,R 

12. farmer: = L

13. — farmer,goat,grass,wolf = L,L,R,R 

14. farmer, goat: = R,R 

15. — farmer,goat,grass,wolf = R,R,R,R

6.

Define an algorithm.

Answer»

An algorithm is a step by step sequence of statements intended to solve a problem. An algorithm starts execution with the input data, executes the statements and finishes execution with the output data.

7.

If O < i before the assignment i : = i – 1 after the assignment, we can conclude that(a) 0 < i (b) 0 ≤ i (c) i = 0 (d) 0 ≥ i

Answer»

Answer is (b) 0 ≤ i

8.

……….. is the left side of the assignment.(a) variable(b) value(c) operator(d) all the above

Answer»

(c) operator

9.

Distinguish between an algorithm and a process.

Answer»

Algorithm:

  • An Algorithm is a sequence of instructions to solve a problem.
  • Elements of a process are abstracted in algorithms.
  • Example: Algorithm can be compared to a recipe 

Process: 

  • A process is executing of instructions to accomplish the intended task.
  • A process is actual execution of the steps to solution.
  • Example: A process can be compared to cooking.
10.

If i: = 3 before the assignment, i: = i + 1 after the assignment ……..(a) 3 (b) 4 (c) 5 (d) 0

Answer»

If i: = 3 before the assignment, i: = i + 1 after the assignment 4

11.

Each part of algorithm is known as ……..(a) input(b) function(c) variable(d) program

Answer»

Each part of algorithm is known as function

12.

…….. statement is used to store a value in a variable. (a) Assignment(b) Sequential control flow(c) Alternative control flow(d) Iterative

Answer»

(a) Assignment

13.

What is the specification of the algorithm?  (a) divide (A + B)(b) square – root (n)(c) square – root (x)(d) adding (A, B)

Answer»

(b) square – root (n)

14.

…….. state the properties of the given input and the relation between the input and the output.(a) Composition(b) Abstraction(c) Decomposition(d) Specification

Answer»

(d) Specification

15.

Ensuring the input – output relation is …… (a) the responsibility of an algorithm and the right of the user.(b) the responsibility of the user and the right of the algorithm.(c) the responsibility of the algorithm but not the right of the user.(d) the responsibility of both the user and the algorithm.

Answer»

(a) the responsibility of an algorithm and the right of the user.

16.

Stating the input property and the input-output relation a problem is known …….. (a) specification (b) statement (c) algorithm (d) definition

Answer»

Stating the input property and the input-output relation a problem is known specification.

17.

…….. how many control flow statement are there to alter the control flow depending on the state?(a) 5(b) 6 (c) 3 (d) 8

Answer»

There are 3 control flow statement to alter the control flow depending on the state.

18.

If i = 5 before the assignment i : = i – 1 after the assignment, the value of i is ……..(a) 5 (b) 4 (c) 3 (d) 2

Answer»

If i = 5 before the assignment i : = i – 1 after the assignment, the value of i is 4

19.

Omitting details inessential to the task and representing only the essential features of the task is known as ……..(a) specification(b) abstraction (c) composition(d) decomposition

Answer»

(b) abstraction

20.

Which of the following activities is not algorithmic in nature?(a) Multiply two numbers(b) Draw a kolam(c) Walk in the park(d) Braid the hair

Answer»

(d) Braid the hair

21.

Which of the following activities is algorithmic in nature?(a) Assemble a bicycle(b) Describe a bicycle(c) Label the parts of a bicycle(d) Explain how a bicycle works

Answer»

(a) Assemble a bicycle

22.

What is the difference between assignment operator and equality operator?

Answer»

Assignment Operator:

Assignment operator is used to assign the values to the variable.

Equality Operator:

The equality operator is used to compare the values of both the variables and the result is true or false.

23.

What is the form and meaning of assignment statement?

Answer»

Assignment statement is used to assign values to the variables. The variable on the left side of the assignment operator and a value on the right side. 

Variable : = Value

24.

What is abstraction?

Answer»

Abstraction:

It is the facility to define objects. It also involves removal of unnecessary attributes and defining only essential attributes.

For example, when we represent the state of a process we select only the variables essential to the problem and ignore inessential details

25.

If – – m, n = 22, 5 and m, n : = m + 3, n – 1 then the value of m and n are …..(a) 25, 4 (b) 24,5 (c) 22, 5 (d) 23,21

Answer»

If – – m, n = 22, 5 and m, n : = m + 3, n – 1 then the value of m and n are 25, 4

26.

If i: = 10 before the assignment, then i: = i % 2 after the assignment(a) 10(b) 5 (c) 0 (d) 1

Answer»

Answer is (c) 0

27.

If i: = 2 before the assignment, then i: = i * 3 after the assignment is ……..(a) 6(b) 5(c) 0(d) 1

Answer»

If i: = 2 before the assignment, then i: = i * 3 after the assignment is 6

28.

Differentiate asymmetric and symmetric algorithms?

Answer»

Symmetric Key Encryption:

1. Same key is used for both encryption and decryption

2. Speed of encryption or decryption is very fast

3. Plain text and cipher text are of same size

4. Algorithms like DES, AES, RC4 uses symmetric key encryption

5. Provides confidentiality

6. The number of key used grows exponentially with the number of users

Asymmetric Key Encryption:

1. Different keys are used for encryption and decryption

2. Speed of encryption or decryption is comparatively slow 

3. The size of cipher text is always greater than plain text. 

4. Algorithms like RSA, ECC, DSA use asymmetric key encryption

5. Provides confidentiality, authenticity and ‘ nonrepudiation

6. The number of key used grows linearly with the number of users

29.

which one of the following is the equality operator?(a) = (b) = = (c) + + (d) – –

Answer»

= = is the equality operator.

30.

which one of the following is the assignment operator?(a) = (b) = = (c) + = = (d) + +

Answer»

= is the assignment operator.

31.

Identify the statement which is not true?(a) An instruction describes an object(b) specification is one of the algorithm design techniques(c) An algorithm is a step by step sequence of instructions

Answer»

(a) An instruction describes an object

32.

Fill in the box given below figure ……(a) processing(b) solving(c) algorithm(d) functions

Answer»

(c) algorithm

33.

When do you say that a problem is algorithmic in nature?

Answer»

A Problem is algorithmic in nature when its solution involves the construction of an algorithm. Also when the

1. Input data and output data of the problem is specified.

2. Relation between the input data and the output data is specified

34.

which one of the following is the comment line in algorithm?(a) + + (b) 1 1 (c) – – (d) = =

Answer»

– – is the comment line in algorithm

35.

Which are the named boxes used for storing data?(a) data (b) variables (c) control flow (d) functions

Answer»

(b) variables

36.

Which one of the following is not a building block of algorithm(a) data (b) state (c) variables (d) functions

Answer»

State is not a building block of algorithm.

37.

Identify the correct statement ……..(a) The first part of specification is name of the algorithm with input (b) Second one is input properties with comments(c) Third one is relation between input – output(d) All the three are correct statements

Answer»

(d) All the three are correct statements

38.

How many basic building blocks construct an algorithm?(a) 3 (b) 4 (c) 5 (d) 8

Answer»

4 basic building blocks construct an algorithm

39.

The order of execution of statement is called : (a) Composition(b) Functions (c) Control flow (d) Specifications

Answer»

(c) Control flow

40.

Instructions of a computer are also known as ….. (a) commands (b) statements (c) Abstractions (d) Functions

Answer»

(b) statements

41.

Find the wrong statement from the following ……(a) The state of a process can be represented by a set of variables in an algorithm(b) The state at any point of execution is simply the values of the variables at that point.(c) As the values of the variables are changed, the state remains constant.(d) As a process evolves, the state changes

Answer»

(c) As the values of the variables are changed, the state remains constant.

42.

Identify the function name: square (A + B) …….. (a) A (b) B (c) A + B (d) square

Answer»

Answer (d) square

43.

Which one of the following statements are not executed the computers?(a) Comment line (b) Header file(c) cin (d) cout

Answer»

(a) Comment line

44.

Match the following1. Sequence of statementfunctions2. Parts of algorithmalgorithm3. Order of execution statementvariable4. Name box to store datacontrol flow(a) 2, 1, 4, 3 (b) 1, 2, 3, 4 (c) 4,3,2, 1 (d) 4, 2, 3, 1

Answer»

(a) 2, 1, 4, 3

45.

Which one of the following defines the rights and responsibilities of the designer and the user?(a) Abstraction(b) Composition(c) Decomposition(d) Specification

Answer»

(d) Specification

46.

Which one of the following statements are used to annotate a program for the human readers? (a) comments (b) state (c) variables(d) functions

Answer»

(a) comments

47.

Match the following1. SpecificationsHiding unnecessary details2. AbstractionsDivides main algorithm into functions3. CompositionRelations between input and output4. DecompositionsAn algorithm is composed of assignment and control flow statement(a) 3, 1, 4, 2(b) 1,2, 3, 4 (c) 4,3,2, 1 (d) 4, 2, 3, 1

Answer»

(a) 3, 1, 4, 2

48.

How is state represented in algorithms?

Answer»

The state represented in a algorithm is set of variables. At any place the value of the variables are substituted and evaluation is done.

49.

In which one of the control flow statements, if the condition is false, then alternative statement will be executed …….. (a) Sequential (b) iterative (c) selection (d) alternative

Answer»

(d) alternative

50.

Asymmetric encryption is also called as …….(a) Secure Electronic Transaction(b) Certification Authority(c) RSA algorithma(d) Payment Information

Answer»

(c) RSA algorithm