Conditionals & Tests interview questions

18 real Conditionals & Tests questions from the Bash bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is Test command?

Junior
  1. A.the dash-prefixed mnemonics like eq, ne, lt, and gt used to compare integers rather than strings inside a test
  2. B.the original conditional primitive, also spelled as a single open bracket, that evaluates file, string, and numeric expressions and sets an exit status
  3. C.the integer a command returns where zero signals success and any nonzero value signals failure, used to drive if and while
  4. D.the equals sign inside a conditional that compares two text values for an exact match rather than arithmetic value
Reveal the answer + AI explanation — free account

2. Which term means: "the original conditional primitive, also spelled as a single open bracket, that evaluates file, string, and numeric expressions and sets an exit status"?

Junior
  1. A.String equality operator
  2. B.Test command
  3. C.Double bracket construct
  4. D.Exit status
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.Test command — the integer a command returns where zero signals success and any nonzero value signals failure, used to drive if and while
  2. B.Test command — the original conditional primitive, also spelled as a single open bracket, that evaluates file, string, and numeric expressions and sets an exit status
  3. C.Test command — the and-and and or-or chaining symbols that run the next command only based on the previous command's success or failure
  4. D.Test command — the dash-prefixed mnemonics like eq, ne, lt, and gt used to compare integers rather than strings inside a test
Reveal the answer + AI explanation — free account

4. What is Double bracket construct?

Mid
  1. A.the and-and and or-or chaining symbols that run the next command only based on the previous command's success or failure
  2. B.the original conditional primitive, also spelled as a single open bracket, that evaluates file, string, and numeric expressions and sets an exit status
  3. C.the integer a command returns where zero signals success and any nonzero value signals failure, used to drive if and while
  4. D.a modern keyword conditional that adds pattern matching and logical operators while avoiding word splitting and glob expansion of unquoted variables
Reveal the answer + AI explanation — free account

5. Which term means: "a modern keyword conditional that adds pattern matching and logical operators while avoiding word splitting and glob expansion of unquoted variables"?

Mid
  1. A.Double bracket construct
  2. B.Exit status
  3. C.Numeric comparison operators
  4. D.String equality operator
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Mid
  1. A.Double bracket construct — the equals sign inside a conditional that compares two text values for an exact match rather than arithmetic value
  2. B.Double bracket construct — the and-and and or-or chaining symbols that run the next command only based on the previous command's success or failure
  3. C.Double bracket construct — the original conditional primitive, also spelled as a single open bracket, that evaluates file, string, and numeric expressions and sets an exit status
  4. D.Double bracket construct — a modern keyword conditional that adds pattern matching and logical operators while avoiding word splitting and glob expansion of unquoted variables
Reveal the answer + AI explanation — free account

7. What is Numeric comparison operators?

Junior
  1. A.a modern keyword conditional that adds pattern matching and logical operators while avoiding word splitting and glob expansion of unquoted variables
  2. B.the original conditional primitive, also spelled as a single open bracket, that evaluates file, string, and numeric expressions and sets an exit status
  3. C.the and-and and or-or chaining symbols that run the next command only based on the previous command's success or failure
  4. D.the dash-prefixed mnemonics like eq, ne, lt, and gt used to compare integers rather than strings inside a test
Reveal the answer + AI explanation — free account

8. Which term means: "the dash-prefixed mnemonics like eq, ne, lt, and gt used to compare integers rather than strings inside a test"?

Junior
  1. A.String equality operator
  2. B.Short-circuit operators
  3. C.Exit status
  4. D.Numeric comparison operators
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Junior
  1. A.Numeric comparison operators — the equals sign inside a conditional that compares two text values for an exact match rather than arithmetic value
  2. B.Numeric comparison operators — the original conditional primitive, also spelled as a single open bracket, that evaluates file, string, and numeric expressions and sets an exit status
  3. C.Numeric comparison operators — the dash-prefixed mnemonics like eq, ne, lt, and gt used to compare integers rather than strings inside a test
  4. D.Numeric comparison operators — the integer a command returns where zero signals success and any nonzero value signals failure, used to drive if and while
Reveal the answer + AI explanation — free account

10. What is String equality operator?

Mid
  1. A.the integer a command returns where zero signals success and any nonzero value signals failure, used to drive if and while
  2. B.the and-and and or-or chaining symbols that run the next command only based on the previous command's success or failure
  3. C.the original conditional primitive, also spelled as a single open bracket, that evaluates file, string, and numeric expressions and sets an exit status
  4. D.the equals sign inside a conditional that compares two text values for an exact match rather than arithmetic value
Reveal the answer + AI explanation — free account

11. Which term means: "the equals sign inside a conditional that compares two text values for an exact match rather than arithmetic value"?

Mid
  1. A.String equality operator
  2. B.Numeric comparison operators
  3. C.Exit status
  4. D.Test command
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.String equality operator — the equals sign inside a conditional that compares two text values for an exact match rather than arithmetic value
  2. B.String equality operator — the dash-prefixed mnemonics like eq, ne, lt, and gt used to compare integers rather than strings inside a test
  3. C.String equality operator — the integer a command returns where zero signals success and any nonzero value signals failure, used to drive if and while
  4. D.String equality operator — the original conditional primitive, also spelled as a single open bracket, that evaluates file, string, and numeric expressions and sets an exit status
Reveal the answer + AI explanation — free account

13. What is Exit status?

Junior
  1. A.the integer a command returns where zero signals success and any nonzero value signals failure, used to drive if and while
  2. B.the original conditional primitive, also spelled as a single open bracket, that evaluates file, string, and numeric expressions and sets an exit status
  3. C.the dash-prefixed mnemonics like eq, ne, lt, and gt used to compare integers rather than strings inside a test
  4. D.the equals sign inside a conditional that compares two text values for an exact match rather than arithmetic value
Reveal the answer + AI explanation — free account

14. Which term means: "the integer a command returns where zero signals success and any nonzero value signals failure, used to drive if and while"?

Junior
  1. A.Exit status
  2. B.Numeric comparison operators
  3. C.Test command
  4. D.String equality operator
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Junior
  1. A.Exit status — the dash-prefixed mnemonics like eq, ne, lt, and gt used to compare integers rather than strings inside a test
  2. B.Exit status — the integer a command returns where zero signals success and any nonzero value signals failure, used to drive if and while
  3. C.Exit status — the and-and and or-or chaining symbols that run the next command only based on the previous command's success or failure
  4. D.Exit status — a modern keyword conditional that adds pattern matching and logical operators while avoiding word splitting and glob expansion of unquoted variables
Reveal the answer + AI explanation — free account

16. What is Short-circuit operators?

Senior
  1. A.the and-and and or-or chaining symbols that run the next command only based on the previous command's success or failure
  2. B.a modern keyword conditional that adds pattern matching and logical operators while avoiding word splitting and glob expansion of unquoted variables
  3. C.the dash-prefixed mnemonics like eq, ne, lt, and gt used to compare integers rather than strings inside a test
  4. D.the equals sign inside a conditional that compares two text values for an exact match rather than arithmetic value
Reveal the answer + AI explanation — free account

17. Which term means: "the and-and and or-or chaining symbols that run the next command only based on the previous command's success or failure"?

Senior
  1. A.String equality operator
  2. B.Short-circuit operators
  3. C.Numeric comparison operators
  4. D.Double bracket construct
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Senior
  1. A.Short-circuit operators — the equals sign inside a conditional that compares two text values for an exact match rather than arithmetic value
  2. B.Short-circuit operators — the and-and and or-or chaining symbols that run the next command only based on the previous command's success or failure
  3. C.Short-circuit operators — a modern keyword conditional that adds pattern matching and logical operators while avoiding word splitting and glob expansion of unquoted variables
  4. D.Short-circuit operators — the dash-prefixed mnemonics like eq, ne, lt, and gt used to compare integers rather than strings inside a test
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Conditionals & Tests free