Functions & Args interview questions

15 real Functions & Args 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 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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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