AWS Developer Associate डोमेन 1: AWS सेवाओं के साथ डेवलपमेंट
AWS Certified Developer – Associate (DVA-C02) परीक्षा के AWS सेवाओं के साथ डेवलपमेंट के लिए 64 मुफ़्त अभ्यास प्रश्न। पहले हर प्रश्न खुद हल करें, फिर सही विकल्प और व्याख्या के लिए "उत्तर दिखाएँ" खोलें।
AWS सेवाओं के साथ डेवलपमेंट अभ्यास प्रश्न
-
प्रश्न 1. Python में लिखे एक Lambda function को invocations के बीच database connection दोबारा उपयोग करना है। Connection कहाँ बनाना चाहिए?
उत्तर दिखाएँ
उत्तर: C. Handler function के बाहर, initialization code में
Handler के बाहर का code हर execution environment में एक बार चलता है, इसलिए warm invocations connection का दोबारा उपयोग करती हैं।
-
प्रश्न 2. एक Lambda function को processing के दौरान 3 GB की अस्थायी file चाहिए। उसे file कहाँ लिखनी चाहिए?
उत्तर दिखाएँ
उत्तर: B. /tmp directory में, ज़रूरत के अनुसार ephemeral storage बढ़ाकर
/tmp लिखने योग्य ephemeral storage है, जिसे 512 MB से 10 GB तक configure किया जा सकता है। /opt और code directory read-only हैं।
-
प्रश्न 3. कई Lambda functions एक जैसी third-party libraries साझा करते हैं। Libraries को एक बार package करके दोबारा कैसे उपयोग करें?
उत्तर दिखाएँ
उत्तर: A. उन्हें Lambda layer के रूप में publish करके हर function से attach करें
Layers shared code या dependencies को package करती हैं। उनकी contents execution environment में /opt में extract होती हैं।
-
प्रश्न 4. एक team चाहती है कि नया code test होते समय production traffic एक stable Lambda identifier की ओर point करे। Production को क्या उपयोग करना चाहिए?
उत्तर दिखाएँ
उत्तर: C. Published version की ओर point करने वाला alias
Published versions अपरिवर्तनीय होते हैं। prod जैसा alias एक version की ओर point करता है और release मंज़ूर होने पर बदला जा सकता है।
-
प्रश्न 5. Lambda alias का 10% traffic नए version पर कैसे भेजा जा सकता है?
उत्तर दिखाएँ
उत्तर: C. Alias पर दो versions के बीच weighted routing configure करें
Alias routing configuration चुने गए प्रतिशत invocations को एक अतिरिक्त version पर भेजती है।
-
प्रश्न 6. एक Lambda function asynchronously invoke होता है और retries के बाद failed events को SQS queue में भेजना है। क्या configure करना चाहिए?
उत्तर दिखाएँ
उत्तर: B. On-failure destination या dead-letter queue
Asynchronous invocations default रूप से दो बार retry होती हैं। Destinations और DLQs उन events को पकड़ते हैं जो फिर भी fail होते हैं।
-
प्रश्न 7. कौन-सी Lambda setting गारंटी देती है कि function हमेशा एक निश्चित संख्या तक concurrent executions scale कर सके?
उत्तर दिखाएँ
उत्तर: C. Reserved concurrency
Reserved concurrency account pool से capacity अलग रखती है और function को उसी value पर cap भी करती है।
-
प्रश्न 8. Lambda पर आधारित एक latency-sensitive API में idle अवधि के बाद पहली requests धीमी होती हैं। इसे क्या कम करता है?
उत्तर दिखाएँ
उत्तर: D. Alias पर provisioned concurrency
Provisioned concurrency initialized execution environments तैयार रखती है, जिससे cold-start initialization time हट जाता है।
-
प्रश्न 9. एक Lambda function SQS queue से पढ़ता है। Lambda messages कैसे प्राप्त करता है?
उत्तर दिखाएँ
उत्तर: D. Event source mapping queue को poll करके function को batches के साथ invoke करता है
Event source mappings SQS, Kinesis, DynamoDB Streams जैसे sources को poll करती हैं, फिर function को synchronously invoke करती हैं।
-
प्रश्न 10. SQS batch में एक message fail होता है जबकि बाकी सफल होते हैं। Lambda पूरे batch को दोबारा process करने से कैसे बच सकता है?
उत्तर दिखाएँ
उत्तर: D. ReportBatchItemFailures enable करें और failed message IDs लौटाएँ
Partial batch responses Lambda को सफल messages delete करने और केवल failed messages queue में लौटाने देते हैं।
-
प्रश्न 11. कौन-सा तरीका database password को Lambda function के code और configuration में plain text से बाहर रखता है?
उत्तर दिखाएँ
उत्तर: B. उसे Secrets Manager में store करके runtime पर fetch करें
Secrets Manager secret को encrypted रूप में store करता है और rotation support करता है। Calls कम करने के लिए value को handler के बाहर cache करें।
-
प्रश्न 12. एक Lambda invocation का अधिकतम timeout कितना है?
उत्तर दिखाएँ
उत्तर: D. 15 मिनट
इससे लंबा काम steps में बाँटना चाहिए, उदाहरण के लिए Step Functions से, या containers में ले जाना चाहिए।
-
प्रश्न 13. एक Lambda function को VPC में private RDS database तक पहुँचना है। क्या configure करना होगा?
उत्तर दिखाएँ
उत्तर: C. Function पर VPC subnets और security groups
VPC-attached function को चुने गए subnets में elastic network interfaces मिलते हैं और वह private resources तक पहुँच सकता है।
-
प्रश्न 14. Private subnets में एक VPC-attached Lambda function को public third-party API call करनी है। उसे क्या चाहिए?
उत्तर दिखाएँ
उत्तर: A. NAT gateway की ओर route
Lambda network interfaces को public IPs नहीं मिलते, इसलिए outbound internet access NAT gateway से होकर जाता है।
-
प्रश्न 15. कौन-सा deployment package विकल्प Lambda function को 10 GB तक की image उपयोग करने देता है?
उत्तर दिखाएँ
उत्तर: D. Amazon ECR में stored container image
Container images 10 GB तक हो सकती हैं। .zip packages unzipped 250 MB तक सीमित हैं।
-
प्रश्न 16. API Gateway में कौन-सा integration type पूरी request Lambda को देता है और Lambda से पूरा response लौटाने की अपेक्षा करता है?
उत्तर दिखाएँ
उत्तर: A. Lambda proxy integration
Proxy integration में function को headers, path और body मिलते हैं और उसे statusCode, headers और body लौटाने होते हैं।
-
प्रश्न 17. एक domain का browser app दूसरे domain पर API Gateway REST API call करता है और CORS error मिलता है। क्या करना होगा?
उत्तर दिखाएँ
उत्तर: A. CORS enable करें ताकि API Access-Control headers लौटाए
Proxy integrations में Lambda function को भी अपने response में Access-Control-Allow-Origin लौटाना होता है।
-
प्रश्न 18. अलग-अलग API Gateway stages को API definition बदले बिना अलग-अलग Lambda aliases call करने हैं। क्या उपयोग करना चाहिए?
उत्तर दिखाएँ
उत्तर: C. Integration में referenced stage variables
${stageVariables.alias} जैसा stage variable हर stage के लिए Lambda alias चुन सकता है।
-
प्रश्न 19. एक partner को प्रति दिन 1,000 API requests तक सीमित करना है। API Gateway में क्या configure करना चाहिए?
उत्तर दिखाएँ
उत्तर: A. Quota और API key के साथ usage plan
Usage plans throttling और quotas परिभाषित करते हैं और clients को दी गई API keys से जुड़े होते हैं।
-
प्रश्न 20. कौन-सा API Gateway feature non-proxy backend को भेजने से पहले request body का format बदलता है?
उत्तर दिखाएँ
उत्तर: C. VTL में लिखे mapping templates
Mapping templates custom (non-proxy) integrations में requests और responses को transform करते हैं।
-
प्रश्न 21. JWT authorization के साथ Lambda को requests forward करने वाली कम लागत, कम latency API के लिए कौन-सा API type चुनना चाहिए?
उत्तर दिखाएँ
उत्तर: B. API Gateway HTTP API
HTTP APIs, REST APIs से सरल और सस्ती हैं और native JWT authorizers शामिल करती हैं।
-
प्रश्न 22. एक chat application को clients और backend के बीच persistent two-way connection चाहिए। कौन-सा API Gateway type उपयुक्त है?
उत्तर दिखाएँ
उत्तर: A. WebSocket API
WebSocket APIs connections खुले रखती हैं और $connect और sendmessage जैसी route key से messages route करती हैं।
-
प्रश्न 23. एक DynamoDB table OrderId को partition key के रूप में उपयोग करती है। App को किसी customer के सभी orders जल्दी लाने हैं। क्या जोड़ना चाहिए?
उत्तर दिखाएँ
उत्तर: D. CustomerId partition key वाला global secondary index
GSIs किसी भी attribute को partition key बना सकते हैं। LSIs को table की partition key साझा करनी होती है।
-
प्रश्न 24. एक ही partition key वाले सभी items लाने के लिए कौन-सा DynamoDB operation सबसे कुशल है?
उत्तर दिखाएँ
उत्तर: D. Query
Query केवल एक partition key के items पढ़ता है। Scan filter करने से पहले पूरी table पढ़ता है।
-
प्रश्न 25. DynamoDB Query response में LastEvaluatedKey लौटाता है। इसका क्या अर्थ है?
उत्तर दिखाएँ
उत्तर: D. और results हैं; अगली बार इसे ExclusiveStartKey के रूप में दें
Query और Scan प्रति call अधिकतम 1 MB लौटाते हैं, इसलिए applications लौटाई गई key से pagination करती हैं।
-
प्रश्न 26. दो users एक ही DynamoDB item को एक साथ update कर सकते हैं। एक update को चुपचाप दूसरे को overwrite करने से कैसे रोकें?
उत्तर दिखाएँ
उत्तर: B. Version attribute के साथ conditional write उपयोग करें
Optimistic locking ConditionExpression में expected version जाँचती है और बदल जाने पर fail होती है।
-
प्रश्न 27. एक order और दो DynamoDB tables में उसका inventory update एक साथ सफल या fail होने चाहिए। क्या उपयोग करना चाहिए?
उत्तर दिखाएँ
उत्तर: C. TransactWriteItems
Transactions items और tables में all-or-nothing writes देते हैं। BatchWriteItem atomic नहीं है।
-
प्रश्न 28. एक table provisioned capacity उपयोग करती है। 6 KB items की प्रति second 10 strongly consistent reads के लिए कितने RCUs चाहिए?
उत्तर दिखाएँ
उत्तर: D. 20
एक RCU प्रति second 4 KB तक की एक strongly consistent read है। 6 KB item 8 KB तक round होता है, यानी 2 RCUs, इसलिए 10 × 2 = 20।
-
प्रश्न 29. प्रति second 5 items, हर एक 2.5 KB, लिखने के लिए कितने WCUs चाहिए?
उत्तर दिखाएँ
उत्तर: A. 15
एक WCU प्रति second 1 KB तक का एक write है। 2.5 KB, 3 KB तक round होता है, इसलिए हर write को 3 WCUs चाहिए, और 5 × 3 = 15।
-
प्रश्न 30. DynamoDB में session items को 24 घंटे बाद बिना अतिरिक्त लागत के अपने-आप delete होना चाहिए। क्या उपयोग करना चाहिए?
उत्तर दिखाएँ
उत्तर: D. Expiry timestamp attribute पर Time to Live (TTL)
TTL write capacity उपयोग किए बिना background में expired items delete करता है।
-
प्रश्न 31. एक Lambda function को DynamoDB table में हुए हर बदलाव पर प्रतिक्रिया देनी है। उसे क्या trigger करे?
उत्तर दिखाएँ
उत्तर: A. Event source mapping के साथ DynamoDB Streams
Streams item-level changes को क्रम में record करती हैं, और Lambda उन्हें batches में process करता है।
-
प्रश्न 32. एक DynamoDB query बड़े items लौटाती है, लेकिन app को केवल दो attributes चाहिए। Response size कैसे कम किया जा सकता है?
उत्तर दिखाएँ
उत्तर: A. ProjectionExpression का उपयोग करें
ProjectionExpression लौटाए गए attributes सीमित करता है। FilterExpression items पढ़ने के बाद उन्हें हटाता है।
-
प्रश्न 33. एक SQS consumer को कभी-कभी एक message के लिए visibility timeout से अधिक समय चाहिए। उसे क्या करना चाहिए?
उत्तर दिखाएँ
उत्तर: B. उस message का timeout बढ़ाने के लिए ChangeMessageVisibility call करें
Processing में चल रहे message की visibility बढ़ाने से दूसरा consumer उसे प्राप्त नहीं करता।
-
प्रश्न 34. SQS queue में भेजे गए messages भेजने के 60 seconds बाद तक consumers को नहीं दिखने चाहिए। क्या set करना चाहिए?
उत्तर दिखाएँ
उत्तर: D. 60 की delivery delay (DelaySeconds)
Delivery delay नए messages को 15 मिनट तक छिपाती है। Visibility timeout message प्राप्त होने के बाद लागू होता है।
-
प्रश्न 35. एक SQS FIFO queue को हर customer के messages क्रम में process करने हैं, जबकि अलग-अलग customers parallel में process हों। क्या set करना चाहिए?
उत्तर दिखाएँ
उत्तर: D. MessageGroupId को customer ID पर
क्रम एक message group के भीतर बना रहता है। अलग-अलग groups एक साथ process हो सकते हैं।
-
प्रश्न 36. Network retry के बाद एक producer FIFO queue में एक ही message दो बार भेज सकता है। Duplicates कैसे रोके जाते हैं?
उत्तर दिखाएँ
उत्तर: A. Content-based deduplication या MessageDeduplicationId
FIFO queues 5-minute deduplication interval में भेजे गए समान deduplication ID वाले messages drop कर देती हैं।
-
प्रश्न 37. एक application को SQS से 2 MB payloads भेजने हैं। अनुशंसित तरीका क्या है?
उत्तर दिखाएँ
उत्तर: C. उसे S3 में store करके reference भेजें, जैसे Extended Client से
SQS messages 256 KB तक सीमित हैं, इसलिए बड़े payloads S3 में store होते हैं और message में pointer होता है।
-
प्रश्न 38. जब application बहुत से छोटे messages भेजती है, तो कौन-सी API call SQS लागत कम करती है?
उत्तर दिखाएँ
उत्तर: D. 10 messages तक के साथ SendMessageBatch
Batching एक request में 10 messages तक भेजता है, जिससे billed API calls कम होती हैं।
-
प्रश्न 39. एक event को अलग-अलग services की तीन SQS queues तक पहुँचाना है। कौन-सा pattern उपयुक्त है?
उत्तर दिखाएँ
उत्तर: B. SNS topic पर publish करें जिसे तीनों queues subscribe करें
SNS-to-SQS fan-out हर subscribed queue को हर message की copy पहुँचाता है।
-
प्रश्न 40. एक SNS subscriber को केवल वे messages मिलने चाहिए जिनमें attribute eventType "refund" हो। क्या उपयोग करना चाहिए?
उत्तर दिखाएँ
उत्तर: A. Subscription filter policy
Filter policies SNS द्वारा evaluate होती हैं, इसलिए non-matching messages उस subscriber को कभी deliver नहीं होते।
-
प्रश्न 41. एक Lambda function केवल तब चलना चाहिए जब कोई EC2 instance "stopped" state में जाए। क्या configure करना चाहिए?
उत्तर दिखाएँ
उत्तर: A. एक EventBridge rule जिसका event pattern उस state change से match करे
EventBridge को EC2 state-change events मिलते हैं, और rule का JSON event pattern detail.state = "stopped" से match करके function को target कर सकता है।
-
प्रश्न 42. एक Lambda function हर दिन 02:00 UTC पर चलना चाहिए। उसे schedule करने का सबसे सरल तरीका क्या है?
उत्तर दिखाएँ
उत्तर: A. EventBridge Scheduler schedule या scheduled rule
EventBridge cron और rate expressions support करता है और function को सीधे invoke करता है।
-
प्रश्न 43. एक order workflow में कई steps, retries, error handling और कई दिन ले सकने वाला manual approval है। कौन-सी service उपयुक्त है?
उत्तर दिखाएँ
उत्तर: B. AWS Step Functions Standard Workflows
Standard Workflows exactly-once execution के साथ एक साल तक चलते हैं। Express Workflows 5 मिनट तक सीमित हैं।
-
प्रश्न 44. एक high-volume event processing workflow प्रति second हज़ारों बार चलता है और seconds में पूरा होता है। कौन-सा Step Functions type सस्ता है?
उत्तर दिखाएँ
उत्तर: C. Express Workflows
Express Workflows executions और duration के आधार पर bill होते हैं और छोटे, high-rate workloads के लिए उपयुक्त हैं।
-
प्रश्न 45. Step Functions में कौन-सा state array के हर item के लिए वही steps चलाता है?
उत्तर दिखाएँ
उत्तर: D. Map
Map items पर iterate करता है, वैकल्पिक रूप से parallel में। Parallel एक साथ अलग-अलग branches चलाता है।
-
प्रश्न 46. Kinesis data stream के records हर device के लिए क्रम में process होने चाहिए। Producer को क्या set करना चाहिए?
उत्तर दिखाएँ
उत्तर: B. Partition key को device ID पर
एक ही partition key वाले records एक ही shard में जाते हैं, जहाँ क्रम बना रहता है।
-
प्रश्न 47. एक Kinesis stream consumer पीछे रह जाता है, और stream में पर्याप्त shards हैं। Lambda processing कैसे तेज़ की जा सकती है?
उत्तर दिखाएँ
उत्तर: A. Event source mapping का parallelization factor बढ़ाएँ
10 तक का parallelization factor Lambda को प्रति shard कई batches process करने देता है, और partition key के अनुसार क्रम बना रहता है।
-
प्रश्न 48. एक browser को AWS credentials के बिना private S3 bucket में सीधे file upload करनी है। Backend को क्या लौटाना चाहिए?
उत्तर दिखाएँ
उत्तर: B. PutObject request के लिए presigned URL
Presigned URLs backend के credentials से signed होते हैं और एक operation के लिए अस्थायी अनुमति देते हैं।
-
प्रश्न 49. जब भी S3 bucket में uploads/ prefix के तहत नया object जोड़ा जाए, एक Lambda function चलना चाहिए। क्या configure करना चाहिए?
उत्तर दिखाएँ
उत्तर: B. Prefix filter के साथ S3 event notification
Event notifications ObjectCreated events को Lambda, SQS, SNS या EventBridge को भेज सकती हैं।
-
प्रश्न 50. एक application DynamoDB में लिखती है और reads को ElastiCache में cache करना चाहती है ताकि cache हमेशा current रहे। कौन-सी strategy उपयुक्त है?
उत्तर दिखाएँ
उत्तर: B. Write-through: हर database write पर cache update करें
Write-through data को current रखता है लेकिन ऐसे items cache कर सकता है जो कभी पढ़े नहीं जाते। TTL जोड़ना मदद करता है।
-
प्रश्न 51. Lazy-loading caching strategy की एक कमी क्या है?
उत्तर दिखाएँ
उत्तर: B. Cache miss से latency बढ़ती है, और cached data पुराना हो सकता है
Lazy loading केवल requested data cache करता है। TTLs सीमित करते हैं कि data कितना पुराना हो सकता है।
-
प्रश्न 52. DynamoDB-backed app को अपने data access code में ज़्यादा बदलाव किए बिना microsecond read latency चाहिए। क्या उपयोग करना चाहिए?
उत्तर दिखाएँ
उत्तर: C. DynamoDB Accelerator (DAX)
DAX, DynamoDB के लिए एक write-through cache है जो compatible API उपयोग करता है।
-
प्रश्न 53. DynamoDB API call ProvisionedThroughputExceededException के साथ fail होती है। Client को क्या करना चाहिए?
उत्तर दिखाएँ
उत्तर: B. Exponential backoff और jitter के साथ retry करें
AWS SDKs throttling errors को backoff के साथ अपने-आप retry करते हैं। लगातार throttling के लिए अधिक capacity या बेहतर keys चाहिए।
-
प्रश्न 54. AWS SDKs में default credential provider chain के बारे में कौन-सा कथन सही है?
उत्तर दिखाएँ
उत्तर: D. यह environment variables, shared files, फिर instance या task roles जाँचती है
AWS compute पर SDK temporary role credentials अपने-आप ले लेता है, इसलिए code में keys की ज़रूरत नहीं होती।
-
प्रश्न 55. एक developer को long-term access keys के बिना laptop से AWS APIs call करनी हैं। क्या अनुशंसित है?
उत्तर दिखाएँ
उत्तर: A. Temporary credentials के लिए aws sso login के साथ IAM Identity Center
IAM Identity Center के short-lived credentials long-term keys store करने से बचाते हैं।
-
प्रश्न 56. एक mobile app को managed GraphQL API चाहिए जो real-time subscriptions के साथ DynamoDB और Lambda का data जोड़े। कौन-सी service उपयुक्त है?
उत्तर दिखाएँ
उत्तर: A. AWS AppSync
AppSync कई data sources के resolvers और built-in subscriptions के साथ GraphQL APIs host करता है।
-
प्रश्न 57. SQS, SNS या EventBridge से trigger होने वाले Lambda functions idempotent क्यों होने चाहिए?
उत्तर दिखाएँ
उत्तर: D. Events एक से अधिक बार deliver हो सकते हैं
At-least-once delivery का अर्थ है कि duplicates हो सकते हैं, इसलिए एक ही event को दो बार process करना सुरक्षित होना चाहिए।
-
प्रश्न 58. एक function payment record लिखता है और event redeliver होने पर दो बार charge नहीं करना चाहिए। एक आम तरीका क्या है?
उत्तर दिखाएँ
उत्तर: A. Conditional write के साथ idempotency key store करें और duplicates छोड़ दें
Idempotency key पर conditional put दोहराए गए event के लिए fail होता है, इसलिए charge दोहराया नहीं जाता।
-
प्रश्न 59. कौन-सा DynamoDB read type सबसे हाल का committed data लौटाता है, दोगुनी read लागत पर?
उत्तर दिखाएँ
उत्तर: A. Strongly consistent read
Strongly consistent reads प्रति 4 KB 1 RCU लेते हैं। Eventually consistent reads की लागत आधी है। GSIs केवल eventual consistency support करते हैं।
-
प्रश्न 60. कम network calls के साथ DynamoDB में बहुत से items लिखने हैं। कौन-सी API मदद करती है, और caller को क्या संभालना होगा?
उत्तर दिखाएँ
उत्तर: D. BatchWriteItem, और किसी भी UnprocessedItems को retry करें
BatchWriteItem प्रति call 25 items तक लिखता है लेकिन unprocessed items लौटा सकता है जिन्हें retry करना होता है।
-
प्रश्न 61. एक table का access pattern है "किसी device के नवीनतम 10 events लाना"। कौन-सा key design सबसे उपयुक्त है?
उत्तर दिखाएँ
उत्तर: C. Partition key deviceId, sort key timestamp, नवीनतम पहले query
ScanIndexForward=false और Limit=10 के साथ Query एक device के नवीनतम items लौटाती है।
-
प्रश्न 62. कौन-सा Lambda feature SQS queue या Kinesis stream के events filter करता है ताकि function केवल matching records के लिए invoke हो?
उत्तर दिखाएँ
उत्तर: C. Event source mapping पर event filtering
Filter criteria event patterns उपयोग करते हैं, जिससे invocations और लागत कम होती है।
-
प्रश्न 63. एक Lambda function को API Gateway invoke करता है। कौन-सा invocation type उपयोग होता है?
उत्तर दिखाएँ
उत्तर: A. Synchronous, इसलिए errors caller को लौटते हैं
API Gateway response की प्रतीक्षा करता है। Synchronous invocations को retry करना caller का काम है।
-
प्रश्न 64. नए object के लिए S3 event notification को rule-based filtering के साथ कई consumers तक पहुँचना चाहिए। क्या enable करना चाहिए?
उत्तर दिखाएँ
उत्तर: B. Bucket पर Amazon EventBridge notifications
EventBridge integration bucket के सभी events को EventBridge भेजता है, जहाँ कई rules उन्हें match और route कर सकते हैं।
AWS, Amazon Web Services और AWS Certified, Amazon.com, Inc. या उसकी सहयोगी कंपनियों के ट्रेडमार्क हैं। ये प्रश्न मौलिक अध्ययन सामग्री हैं, असली परीक्षा के प्रश्न नहीं।