Functions & Args interview questions

15 Functions & Args 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 Function definition?

Junior
  1. A.a command that discards the first positional argument and renumbers the rest downward, handy for processing options one at a time
  2. B.a named, reusable block of commands invoked by name, declared either with a keyword prefix or with a trailing pair of parentheses
  3. C.a builtin that ends a function and sets its exit status to a small integer, distinct from emitting a result via standard output
  4. D.a keyword that scopes a variable to the current function so assignments do not leak out and clobber the caller's environment

Answer + AI explanation with Pro

2. Which term means: "a named, reusable block of commands invoked by name, declared either with a keyword prefix or with a trailing pair of parentheses"?

Junior
  1. A.Positional parameters
  2. B.Function definition
  3. C.Shift builtin
  4. D.Local declaration

Answer + AI explanation with Pro

3. Which statement is correct?

Junior
  1. A.Function definition — the automatically populated arguments passed to a script or function, referenced by their ordinal number such as one, two, and three
  2. B.Function definition — a named, reusable block of commands invoked by name, declared either with a keyword prefix or with a trailing pair of parentheses
  3. C.Function definition — a keyword that scopes a variable to the current function so assignments do not leak out and clobber the caller's environment
  4. D.Function definition — a command that discards the first positional argument and renumbers the rest downward, handy for processing options one at a time

Answer + AI explanation with Pro

4. What is Positional parameters?

Junior
  1. A.a keyword that scopes a variable to the current function so assignments do not leak out and clobber the caller's environment
  2. B.the automatically populated arguments passed to a script or function, referenced by their ordinal number such as one, two, and three
  3. C.a builtin that ends a function and sets its exit status to a small integer, distinct from emitting a result via standard output
  4. D.a named, reusable block of commands invoked by name, declared either with a keyword prefix or with a trailing pair of parentheses

Answer + AI explanation with Pro

5. Which term means: "the automatically populated arguments passed to a script or function, referenced by their ordinal number such as one, two, and three"?

Junior
  1. A.Function definition
  2. B.Local declaration
  3. C.Return statement
  4. D.Positional parameters

Answer + AI explanation with Pro

6. Which statement is correct?

Junior
  1. A.Positional parameters — a command that discards the first positional argument and renumbers the rest downward, handy for processing options one at a time
  2. B.Positional parameters — the automatically populated arguments passed to a script or function, referenced by their ordinal number such as one, two, and three
  3. C.Positional parameters — a named, reusable block of commands invoked by name, declared either with a keyword prefix or with a trailing pair of parentheses
  4. D.Positional parameters — a keyword that scopes a variable to the current function so assignments do not leak out and clobber the caller's environment

Answer + AI explanation with Pro

7. What is Shift builtin?

Mid
  1. A.a named, reusable block of commands invoked by name, declared either with a keyword prefix or with a trailing pair of parentheses
  2. B.a builtin that ends a function and sets its exit status to a small integer, distinct from emitting a result via standard output
  3. C.a command that discards the first positional argument and renumbers the rest downward, handy for processing options one at a time
  4. D.the automatically populated arguments passed to a script or function, referenced by their ordinal number such as one, two, and three

Answer + AI explanation with Pro

8. Which term means: "a command that discards the first positional argument and renumbers the rest downward, handy for processing options one at a time"?

Mid
  1. A.Positional parameters
  2. B.Return statement
  3. C.Shift builtin
  4. D.Function definition

Answer + AI explanation with Pro

9. Which statement is correct?

Mid
  1. A.Shift builtin — the automatically populated arguments passed to a script or function, referenced by their ordinal number such as one, two, and three
  2. B.Shift builtin — a builtin that ends a function and sets its exit status to a small integer, distinct from emitting a result via standard output
  3. C.Shift builtin — a command that discards the first positional argument and renumbers the rest downward, handy for processing options one at a time
  4. D.Shift builtin — a named, reusable block of commands invoked by name, declared either with a keyword prefix or with a trailing pair of parentheses

Answer + AI explanation with Pro

10. What is Return statement?

Mid
  1. A.the automatically populated arguments passed to a script or function, referenced by their ordinal number such as one, two, and three
  2. B.a keyword that scopes a variable to the current function so assignments do not leak out and clobber the caller's environment
  3. C.a builtin that ends a function and sets its exit status to a small integer, distinct from emitting a result via standard output
  4. D.a command that discards the first positional argument and renumbers the rest downward, handy for processing options one at a time

Answer + AI explanation with Pro

11. Which term means: "a builtin that ends a function and sets its exit status to a small integer, distinct from emitting a result via standard output"?

Mid
  1. A.Return statement
  2. B.Function definition
  3. C.Positional parameters
  4. D.Shift builtin

Answer + AI explanation with Pro

12. Which statement is correct?

Mid
  1. A.Return statement — a builtin that ends a function and sets its exit status to a small integer, distinct from emitting a result via standard output
  2. B.Return statement — a keyword that scopes a variable to the current function so assignments do not leak out and clobber the caller's environment
  3. C.Return statement — a command that discards the first positional argument and renumbers the rest downward, handy for processing options one at a time
  4. D.Return statement — a named, reusable block of commands invoked by name, declared either with a keyword prefix or with a trailing pair of parentheses

Answer + AI explanation with Pro

13. What is Local declaration?

Senior
  1. A.a named, reusable block of commands invoked by name, declared either with a keyword prefix or with a trailing pair of parentheses
  2. B.a keyword that scopes a variable to the current function so assignments do not leak out and clobber the caller's environment
  3. C.the automatically populated arguments passed to a script or function, referenced by their ordinal number such as one, two, and three
  4. D.a builtin that ends a function and sets its exit status to a small integer, distinct from emitting a result via standard output

Answer + AI explanation with Pro

14. Which term means: "a keyword that scopes a variable to the current function so assignments do not leak out and clobber the caller's environment"?

Senior
  1. A.Local declaration
  2. B.Function definition
  3. C.Return statement
  4. D.Shift builtin

Answer + AI explanation with Pro

15. Which statement is correct?

Senior
  1. A.Local declaration — the automatically populated arguments passed to a script or function, referenced by their ordinal number such as one, two, and three
  2. B.Local declaration — a builtin that ends a function and sets its exit status to a small integer, distinct from emitting a result via standard output
  3. C.Local declaration — a command that discards the first positional argument and renumbers the rest downward, handy for processing options one at a time
  4. D.Local declaration — a keyword that scopes a variable to the current function so assignments do not leak out and clobber the caller's environment

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 Functions & Args 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