AWS Simple Queue Service practice questions-

 

1. Which AWS service can help design architecture to persist in-flight transactions?
a. Elastic IP Address
b. SQS
c. Amazon CloudWatch
d. Amazon ElastiCache

[showhide type=”q1″ more_text=”Answer is…” less_text=”Show less…”]
b. SQS
[/showhide]
 
2. A company has a workflow that sends video files from their on-premise system to AWS for transcoding. They use EC2 worker instances that pull transcoding jobs from SQS. Why is SQS an appropriate service for this scenario?
a. SQS guarantees the order of the messages.
b. SQS synchronously provides transcoding output.
c. SQS checks the health of the worker instances.
d. SQS helps to facilitate horizontal scaling of encoding tasks

[showhide type=”q2″ more_text=”Answer is…” less_text=”Show less…”]
d. SQS helps to facilitate horizontal scaling of encoding tasks
[/showhide]
 
3. Which statement best describes an Amazon SQS use case?
a. Automate the process of sending an email notification to administrators when the CPU utilization reaches 70% on production servers (Amazon EC2 instances)
b. Create a video transcoding website where multiple components need to communicate with each other, but can’t all process the same amount of work simultaneously
c. Coordinate work across distributed web services to process employee’s expense reports
d. Distribute static web content to end users with low latency across multiple countries

[showhide type=”q3″ more_text=”Answer is…” less_text=”Show less…”]
b. Create a video transcoding website where multiple components need to communicate with each other, but can’t all process the same amount of work simultaneously
[/showhide]
 
4. Your application provides data transformation services. Files containing data to be transformed are first uploaded to Amazon S3 and then transformed by a fleet of spot EC2 instances. Files submitted by your premium customers must be transformed with the highest priority. How should you implement such a system?
a. Use a DynamoDB table with an attribute defining the priority level. Transformation instances will scan the table for tasks, sorting the results by priority level.
b. Use Route 53 latency based-routing to send high priority tasks to the closest transformation instances.
c. Use two SQS queues, one for high priority messages, and the other for default priority. Transformation instances first poll the high priority queue; if there is no message, they poll the default priority queue
d. Use a single SQS queue. Each message contains the priority level. Transformation instances poll high-priority messages first.

[showhide type=”q4″ more_text=”Answer is…” less_text=”Show less…”]
c. Use two SQS queues, one for high priority messages, and the other for default priority. Transformation instances first poll the high priority queue; if there is no message, they poll the default priority queue
[/showhide]
 
5. Your company plans to host a large donation website on Amazon Web Services (AWS). You anticipate a large and undetermined amount of traffic that will create many database writes. To be certain that you do not drop any writes to a database hosted on AWS. Which service should you use?
a. Amazon RDS with provisioned IOPS up to the anticipated peak write throughput.
b. Amazon Simple Queue Service (SQS) for capturing the writes and draining the queue to write to the database
c. Amazon ElastiCache to store the writes until the writes are committed to the database.
d. Amazon DynamoDB with provisioned write throughput up to the anticipated peak write throughput.

[showhide type=”q5″ more_text=”Answer is…” less_text=”Show less…”]
b. Amazon Simple Queue Service (SQS) for capturing the writes and draining the queue to write to the database
[/showhide]
 
6. A customer has a 10 GB AWS Direct Connect connection to an AWS region where they have a web application hosted on Amazon Elastic Compute Cloud (EC2). The application has dependencies on an on-premises mainframe database that uses a BASE (Basic Available, Soft state, Eventual consistency) rather than an ACID (Atomicity, Consistency, Isolation, Durability) consistency model. The application is exhibiting undesirable behavior because the database is not able to handle the volume of writes. How can you reduce the load on your on-premises database resources in the most cost-effective way?
a. Use an Amazon Elastic Map Reduce (EMR) S3DistCp as a synchronization mechanism between the onpremises database and a Hadoop cluster on AWS.
b. Modify the application to write to an Amazon SQS queue and develop a worker process to flush the queue to the on-premises database
c. Modify the application to use DynamoDB to feed an EMR cluster which uses a map function to write to the on-premises database.
d. Provision an RDS read-replica database on AWS to handle the writes and synchronize the two databases using Data Pipeline.

[showhide type=”q6″ more_text=”Answer is…” less_text=”Show less…”]
b. Modify the application to write to an Amazon SQS queue and develop a worker process to flush the queue to the on-premises database
[/showhide]
 
7. An organization has created a Queue named “modularqueue” with SQS. The organization is not performing any operations such as SendMessage, ReceiveMessage, DeleteMessage, GetQueueAttributes, SetQueueAttributes, AddPermission, and RemovePermission on the queue. What can happen in this scenario?
a. AWS SQS sends notification after 15 days for inactivity on queue
b. AWS SQS can delete queue after 30 days without notification
c. AWS SQS marks queue inactive after 30 days
d. AWS SQS notifies the user after 2 weeks and deletes the queue after 3 weeks.

[showhide type=”q7″ more_text=”Answer is…” less_text=”Show less…”]
b. AWS SQS can delete queue after 30 days without notification
[/showhide]
 
8. A user is using the AWS SQS to decouple the services. Which of the below mentioned operations is not supported by SQS?
a. SendMessageBatch
b. DeleteMessageBatch
c. CreateQueue
d. DeleteMessageQueue

[showhide type=”q8″ more_text=”Answer is…” less_text=”Show less…”]
d. DeleteMessageQueue
[/showhide]
 
9. A user has created a queue named “awsmodule” with SQS. One of the consumers of queue is down for 3 days and then becomes available. Will that component receive message from queue?
a. Yes, since SQS by default stores message for 4 days
b. No, since SQS by default stores message for 1 day only
c. No, since SQS sends message to consumers who are available that time
d. Yes, since SQS will not delete message until it is delivered to all consumers

[showhide type=”q9″ more_text=”Answer is…” less_text=”Show less…”]
a. Yes, since SQS by default stores message for 4 days
[/showhide]
 
10. A user has created a queue named “queue2” in US-East region with AWS SQS. The user’s AWS account ID is 123456789012. If the user wants to perform some action on this queue, which of the below Queue URL should he use?
a. http://sqs.us-east-1.amazonaws.com/123456789012/queue2
b. http://sqs.amazonaws.com/123456789012/queue2
c. http://sqs. 123456789012.us-east-1.amazonaws.com/queue2
d. http://123456789012.sqs.us-east-1.amazonaws.com/queue2

[showhide type=”q10″ more_text=”Answer is…” less_text=”Show less…”]
a. http://sqs.us-east-1.amazonaws.com/123456789012/queue2
[/showhide]




11. A user has created a queue named “myqueue” with SQS. There are four messages published to queue, which are not received by the consumer yet. If the user tries to delete the queue, what will happen?
a. A user can never delete a queue manually. AWS deletes it after 30 days of inactivity on queue
b. It will delete the queue
c. It will initiate the delete but wait for four days before deleting until all messages are deleted automatically.
d. I t will ask user to delete the messages first

[showhide type=”q11″ more_text=”Answer is…” less_text=”Show less…”]
b. It will delete the queue
[/showhide]
 
12. A user has developed an application, which is required to send the data to a NoSQL database. The user wants to decouple the data sending such that the application keeps processing and sending data but does not wait for an acknowledgement of DB. Which of the below mentioned applications helps in this scenario?
a. AWS Simple Notification Service
b. AWS Simple Workflow
c. AWS Simple Queue Service
d. AWS Simple Query Service

[showhide type=”q12″ more_text=”Answer is…” less_text=”Show less…”]
c. AWS Simple Queue Service
[/showhide]
 
13. You are building an online store on AWS that uses SQS to process your customer orders. Your backend system needs those messages in the same sequence the customer orders have been put in. How can you achieve that?
a. It is not possible to do this with SQS
b. You can use sequencing information on each message
c. You can do this with SQS but you also need to use SWF
d. Messages will arrive in the same order by default

[showhide type=”q13″ more_text=”Answer is…” less_text=”Show less…”]
b. You can use sequencing information on each message
[/showhide]
 
14. A user has created a photo editing software and hosted it on EC2. The software accepts requests from the user about the photo format and resolution and sends a message to S3 to enhance the picture accordingly. Which of the below mentioned AWS services will help make a scalable software with the AWS infrastructure in this scenario?
a. AWS Glacier
b. AWS Elastic Transcoder
c. AWS Simple Notification Service
d. AWS Simple Queue Service

[showhide type=”q14″ more_text=”Answer is…” less_text=”Show less…”]
d. AWS Simple Queue Service
[/showhide]
 
15. Refer to the architecture diagram of a batch processing solution using Simple Queue Service (SQS) to set up a message queue between EC2 instances, which are used as batch processors. Cloud Watch monitors the number of Job requests (queued messages) and an Auto Scaling group adds or deletes batch servers automatically based on parameters set in Cloud Watch alarms. You can use this architecture to implement which of the following features in a cost effective and efficient manner?
a. Reduce the overall time for executing jobs through parallel processing by allowing a busy EC2 instance that receives a message to pass it to the next instance in a daisy-chain setup.
b. Implement fault tolerance against EC2 instance failure since messages would remain in SQS and worn can continue with recovery of EC2 instances implement fault tolerance against SQS failure by backing up messages to S3.
c. Implement message passing between EC2 instances within a batch by exchanging messages through SOS.
d. Coordinate number of EC2 instances with number of job requests automatically thus Improving cost effectiveness
e. Handle high priority jobs before lower priority jobs by assigning a priority metadata field to SQS messages.

[showhide type=”q15″ more_text=”Answer is…” less_text=”Show less…”]
d. Coordinate number of EC2 instances with number of job requests automatically thus Improving cost effectiveness
[/showhide]
 
16. How does Amazon SQS allow multiple readers to access the same message queue without losing messages or processing them many times?
a. By identifying a user by his unique id
b. By using unique cryptography
c. Amazon SQS queue has a configurable visibility timeout
d. Multiple readers can’t access the same message queue

[showhide type=”q16″ more_text=”Answer is…” less_text=”Show less…”]
c. Amazon SQS queue has a configurable visibility timeout
[/showhide]
 

17. How do you configure SQS to support longer message retention?
a. Set the MessageRetentionPeriod attribute using the SetQueueAttributes method
b. Using a Lambda function
c. You can’t. It is set to 14 days and cannot be changed
d. You need to request it from AWS

[showhide type=”q17″ more_text=”Answer is…” less_text=”Show less…”]
a. Set the MessageRetentionPeriod attribute using the SetQueueAttributes method
[/showhide]

 
18. If a message is retrieved from a queue in Amazon SQS, how long is the message inaccessible to other users by default?
a. 0 seconds
b. 1 hour
c. 1 day
d. forever
e. 30 seconds

[showhide type=”q18″ more_text=”Answer is…” less_text=”Show less…”]
e. 30 seconds
[/showhide]




19. Which of the following statements about SQS is true?
a. Messages will be delivered exactly once and messages will be delivered in First in, First out order
b. Messages will be delivered exactly once and message delivery order is indeterminate
c. Messages will be delivered one or more times and messages will be delivered in First in, First out order
d. Messages will be delivered one or more times and message delivery order is indeterminate

[showhide type=”q19″ more_text=”Answer is…” less_text=”Show less…”]
d. Messages will be delivered one or more times and message delivery order is indeterminate
[/showhide]
 
20. How long can you keep your Amazon SQS messages in Amazon SQS queues?
a. From 120 secs up to 4 weeks
b. From 10 secs up to 7 days
c. From 60 secs up to 2 weeks
d. From 30 secs up to 1 week

[showhide type=”q20″ more_text=”Answer is…” less_text=”Show less…”]
c. From 60 secs up to 2 weeks
[/showhide]
 
21. When a Simple Queue Service message triggers a task that takes 5 minutes to complete, which process below will result in successful processing of the message and remove it from the queue while minimizing the chances of duplicate processing?
a. Retrieve the message with an increased visibility timeout, process the message, delete the message from the queue
b. Retrieve the message with an increased visibility timeout, delete the message from the queue, process the message
c. Retrieve the message with increased DelaySeconds, process the message, delete the message from the queue
d. Retrieve the message with increased DelaySeconds, delete the message from the queue, process the message

[showhide type=”q21″ more_text=”Answer is…” less_text=”Show less…”]
a. Retrieve the message with an increased visibility timeout, process the message, delete the message from the queue
[/showhide]
 
22. You need to process long-running jobs once and only once. How might you do this?
a. Use an SNS queue and set the visibility timeout to long enough for jobs to process.
b. Use an SQS queue and set the reprocessing timeout to long enough for jobs to process.
c. Use an SQS queue and set the visibility timeout to long enough for jobs to process.
d. Use an SNS queue and set the reprocessing timeout to long enough for jobs to process.

[showhide type=”q22″ more_text=”Answer is…” less_text=”Show less…”]
c. Use an SQS queue and set the visibility timeout to long enough for jobs to process.
[/showhide]
 
23. You are getting a lot of empty receive requests when using Amazon SQS. This is making a lot of unnecessary network load on your instances. What can you do to reduce this load?
a. Subscribe your queue to an SNS topic instead.
b. Use as long of a poll as possible, instead of short polls.
c. Alter your visibility timeout to be shorter.
d. Use sqsd on your EC2 instances.

[showhide type=”q23″ more_text=”Answer is…” less_text=”Show less…”]
b. Use as long of a poll as possible, instead of short polls.
[/showhide]
 
24. You have an asynchronous processing application using an Auto Scaling Group and an SQS Queue. The Auto Scaling Group scales according to the depth of the job queue. The completion velocity of the jobs has gone down, the Auto Scaling Group size has maxed out, but the inbound job velocity did not increase. What is a possible issue?
a. Some of the new jobs coming in are malformed and unprocessable.
b. The routing tables changed and none of the workers can process events anymore.
c. Someone changed the IAM Role Policy on the instances in the worker group and broke permissions to access the queue.
d. The scaling metric is not functioning correctly.

[showhide type=”q24″ more_text=”Answer is…” less_text=”Show less…”]
a. Some of the new jobs coming in are malformed and unprocessable.
[/showhide]
 
25. Company B provides an online image recognition service and utilizes SQS to decouple system components for scalability. The SQS consumers poll the imaging queue as often as possible to keep end-to-end throughput as high as possible. However, Company B is realizing that polling in tight loops is burning CPU cycles and increasing costs with empty responses. How can Company B reduce the number of empty responses?
a. Set the imaging queue visibility Timeout attribute to 20 seconds
b. Set the Imaging queue ReceiveMessageWaitTimeSeconds attribute to 20 seconds
c. Set the imaging queue MessageRetentionPeriod attribute to 20 seconds
d. Set the DelaySeconds parameter of a message to 20 seconds

[showhide type=”q25″ more_text=”Answer is…” less_text=”Show less…”]
b. Set the Imaging queue ReceiveMessageWaitTimeSeconds attribute to 20 seconds
[/showhide]