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
A.a command that discards the first positional argument and renumbers the rest downward, handy for processing options one at a time
B.a named, reusable block of commands invoked by name, declared either with a keyword prefix or with a trailing pair of parentheses
C.a builtin that ends a function and sets its exit status to a small integer, distinct from emitting a result via standard output
D.a keyword that scopes a variable to the current function so assignments do not leak out and clobber the caller's environment
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"?
A.Function definition — the automatically populated arguments passed to a script or function, referenced by their ordinal number such as one, two, and three
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
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
D.Function definition — a command that discards the first positional argument and renumbers the rest downward, handy for processing options one at a time
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"?
A.Positional parameters — a command that discards the first positional argument and renumbers the rest downward, handy for processing options one at a time
B.Positional parameters — the automatically populated arguments passed to a script or function, referenced by their ordinal number such as one, two, and three
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
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
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"?
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"?
A.Local declaration — the automatically populated arguments passed to a script or function, referenced by their ordinal number such as one, two, and three
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
C.Local declaration — a command that discards the first positional argument and renumbers the rest downward, handy for processing options one at a time
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
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.