In a HashMap implementation used at Infosys, what happens when the load factor exceeds the threshold?
AThe HashMap is locked and becomes read-only
BThe HashMap is rehashed with a larger capacity
CAll entries are deleted automatically
DThe oldest entries are removed
Correct Answer:
B. The HashMap is rehashed with a larger capacity
Explanation:
When the load factor (ratio of entries to capacity) exceeds the threshold, the HashMap is rehashed with approximately double the capacity to maintain performance.
In Infosys' microservices architecture, which design pattern is used to manage distributed transactions across multiple services?
ASaga Pattern
BFactory Pattern
CSingleton Pattern
DObserver Pattern
Correct Answer:
A. Saga Pattern
Explanation:
The Saga pattern is used in microservices to manage distributed transactions by breaking them into local transactions coordinated through event-driven communication.
What is the primary purpose of Docker containerization technology used by Infosys developers?
ATo increase application size
BTo ensure consistency between development and production environments
CTo reduce network bandwidth
DTo eliminate the need for databases
Correct Answer:
B. To ensure consistency between development and production environments
Explanation:
Docker containerization ensures that applications run consistently across different environments by packaging the application with all its dependencies.
An Infosys developer needs to optimize a SQL query that joins 4 tables. The query currently takes 8 seconds to execute. Which indexing strategy would be most effective?
AIndex only the primary key columns
BCreate composite indexes on join columns and filter conditions
CIndex all columns in the tables
DRemove all existing indexes
Correct Answer:
B. Create composite indexes on join columns and filter conditions
Explanation:
Composite indexes on join columns and WHERE clause conditions significantly improve query performance by reducing the number of rows scanned.
In Infosys' cloud infrastructure, what does the term 'elasticity' refer to?
AThe ability to stretch applications across regions
BThe ability to automatically scale resources up or down based on demand
CThe flexibility in choosing programming languages
DThe resistance of systems to failures
Correct Answer:
B. The ability to automatically scale resources up or down based on demand
Explanation:
Elasticity in cloud computing refers to the automatic scaling of resources to meet changing demand, ensuring optimal resource utilization and cost efficiency.
An Infosys project uses Apache Kafka for real-time data streaming. If a consumer group has 5 consumers and the topic has 8 partitions, how many consumers will remain idle?
A3 consumers
B2 consumers
C1 consumer
D0 consumers
Correct Answer:
A. 3 consumers
Explanation:
In Kafka, the maximum number of active consumers in a group equals the number of partitions. With 8 partitions and 5 consumers, only 3 will remain idle.
The Richardson Maturity Model progresses from the Swamp (0), to Resources (1), HTTP Verbs (2), and finally Hypermedia (3) as the highest level of REST maturity.
In Infosys' DevOps pipeline, which tool is primarily used for continuous integration and continuous deployment (CI/CD)?
AJenkins
BSlack
CPostman
DGit
Correct Answer:
A. Jenkins
Explanation:
Jenkins is the leading open-source automation server widely used by Infosys for implementing CI/CD pipelines to automate testing and deployment processes.
An Infosys data engineer needs to process 10 TB of unstructured data. Which Apache tool would be most suitable for batch processing?
AApache Spark
BApache NiFi
CApache Hadoop MapReduce
DApache Storm
Correct Answer:
A. Apache Spark
Explanation:
Apache Spark is superior for large-scale batch processing due to its in-memory computing capabilities, providing faster execution than MapReduce for processing large datasets.
In thread-safe programming at Infosys, which Java construct provides the most granular level of locking?
ASynchronized method
BSynchronized block
CReentrantReadWriteLock
DVolatile keyword
Correct Answer:
C. ReentrantReadWriteLock
Explanation:
ReentrantReadWriteLock provides separate read and write locks, allowing multiple readers but only one writer, offering finer-grained control than basic synchronized constructs.