D278 ITSW 2113
Scripting & Programming Foundations
Latest Objective Assessment Review
(With Solutions)
2026
1
,Multiple Choice Questions (MCQs)
You need to automate the deployment of AWS Lambda functions using
Python. Which AWS SDK module allows programmatic creation and
updating of Lambda functions?
a) boto3.lambda
b) boto3.client('lambda')
c) boto3.resource('lambda')
d) boto3.aws_lambda
Answer: b) boto3.client('lambda')
Rationale: The boto3 client interface provides direct access to AWS
Lambda methods like create_function and update_function_code. The
resource interface is not implemented for Lambda.
In a Python script that manages AWS EC2 instances, what is the effect of
using paginators in the boto3 library?
a) They allow you to paginate API responses when there are multiple
pages.
b) They optimize EC2 instance billing.
c) They automate instance updates.
d) They flatten JSON objects from instance metadata.
Answer: a) They allow you to paginate API responses when there are
multiple pages.
Rationale: AWS API calls that return large datasets use pagination.
Paginators help iterate through all results seamlessly.
Which scripting language is most commonly used with AWS
CloudFormation custom resources to add logic and is fully supported by
AWS Lambda?
a) Ruby
b) Python
2
, c) Perl
d) PHP
Answer: b) Python
Rationale: Python is widely used for AWS Lambda and custom resource
scripting due to built-in library support and AWS compatibility.
When scripting AWS CLI commands inside a bash script, which command
syntax ensures the script captures both stdout and stderr for logging?
a) aws ec2 describe-instances > output.log
b) aws ec2 describe-instances 2> error.log
c) aws ec2 describe-instances &> output.log
d) aws ec2 describe-instances 1> output.log & 2> error.log
Answer: c) aws ec2 describe-instances &> output.log
Rationale: The &> redirects both stdout and stderr to the same file,
useful for complete log capture in bash scripts.
To write idempotent infrastructure provisioning scripts for AWS using
Python, which of the following best practice ensures safe repeated
execution?
a) Always delete resources before creating.
b) Use ‘create’ calls only and fail if resource exists.
c) Use ‘describe’ APIs to check for resource existence before
create/update.
d) Use the AWS CLI instead of SDK for scripting.
Answer: c) Use ‘describe’ APIs to check for resource existence before
create/update.
Rationale: Idempotency requires verifying resource state before actions
to avoid duplication or errors.
True/False Questions
True or False: In AWS SDK for Python (boto3), session-based clients
3
Scripting & Programming Foundations
Latest Objective Assessment Review
(With Solutions)
2026
1
,Multiple Choice Questions (MCQs)
You need to automate the deployment of AWS Lambda functions using
Python. Which AWS SDK module allows programmatic creation and
updating of Lambda functions?
a) boto3.lambda
b) boto3.client('lambda')
c) boto3.resource('lambda')
d) boto3.aws_lambda
Answer: b) boto3.client('lambda')
Rationale: The boto3 client interface provides direct access to AWS
Lambda methods like create_function and update_function_code. The
resource interface is not implemented for Lambda.
In a Python script that manages AWS EC2 instances, what is the effect of
using paginators in the boto3 library?
a) They allow you to paginate API responses when there are multiple
pages.
b) They optimize EC2 instance billing.
c) They automate instance updates.
d) They flatten JSON objects from instance metadata.
Answer: a) They allow you to paginate API responses when there are
multiple pages.
Rationale: AWS API calls that return large datasets use pagination.
Paginators help iterate through all results seamlessly.
Which scripting language is most commonly used with AWS
CloudFormation custom resources to add logic and is fully supported by
AWS Lambda?
a) Ruby
b) Python
2
, c) Perl
d) PHP
Answer: b) Python
Rationale: Python is widely used for AWS Lambda and custom resource
scripting due to built-in library support and AWS compatibility.
When scripting AWS CLI commands inside a bash script, which command
syntax ensures the script captures both stdout and stderr for logging?
a) aws ec2 describe-instances > output.log
b) aws ec2 describe-instances 2> error.log
c) aws ec2 describe-instances &> output.log
d) aws ec2 describe-instances 1> output.log & 2> error.log
Answer: c) aws ec2 describe-instances &> output.log
Rationale: The &> redirects both stdout and stderr to the same file,
useful for complete log capture in bash scripts.
To write idempotent infrastructure provisioning scripts for AWS using
Python, which of the following best practice ensures safe repeated
execution?
a) Always delete resources before creating.
b) Use ‘create’ calls only and fail if resource exists.
c) Use ‘describe’ APIs to check for resource existence before
create/update.
d) Use the AWS CLI instead of SDK for scripting.
Answer: c) Use ‘describe’ APIs to check for resource existence before
create/update.
Rationale: Idempotency requires verifying resource state before actions
to avoid duplication or errors.
True/False Questions
True or False: In AWS SDK for Python (boto3), session-based clients
3