Conditionals & Tests interview questions

18 Conditionals & Tests questions from the Bash bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Free to start: the 2-minute IT readiness check — six questions and a result.

Take the free IT readiness check

or take a mock interview set up for this area

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

Free to start

Start with a free readiness check

Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every Conditionals & Tests question come with Pro.

Take the free IT readiness check

or take a mock interview set up for this area

24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers