OCI
Certification
- OCI generative AI
- Multiclould
AWS Certified Solutions Architect Associate
- Exam1
- Exam2
- Exam3
- Exam4
- Exam5
- Quick Notes
- Developer Associate Revision
- Services and use case
- Common Exam scenarios :
- White papers
- Summary from exams, topic-wise
Domain (TRY TO MAP QS to this domain)
- Design Secure Architectures
- Design Secure Applications and Architectures
- Design Resilient Architectures
- Design High-Performing Architectures
- Design Cost-Optimized Architectures
AWS interview Questions
AWS Lambda
- How did you handle cold starts in AWS Lambda with Spring Boot?
- (Spring Boot + Cold Start) issue specific with SB
Amazon S3
- What is S3 Lifecycle Management, and how did you use it?
- How did you ensure security for data stored in S3?
Amazon DynamoDB
- How is DynamoDB different from Amazon RDS?
- Does DynamoDB have indexes? If yes, what types and how are they used?
- What is TTL in dynamo db?
Amazon RDS
- Does Amazon RDS support indexing?
- What are the types of indexes supported in RDS, and how do they compare with DynamoDB indexes?
CI/CD on AWS
- What CI/CD tools did you use with AWS?
Answers
AWS Lambda
- How did you handle cold starts in AWS Lambda with Spring Boot?
- “used Spring Cloud Function to reduce Lambda cold starts by packaging only the required business logic as a Java Function. This allowed us to skip full context loading and significantly reduced cold start latency compared to traditional Spring Boot REST applications. We combined this with SnapStart and minimal dependencies to get near real-time performance.”
Cold Start Comparison (Typical Benchmarks)
| Framework | Cold Start Time (avg) |
|---|---|
| Spring Boot REST API | 3–6 seconds |
| Spring Cloud Function | 1–2 seconds (less with SnapStart) |
| Micronaut | < 1 second |
| Quarkus + GraalVM | ~100–200ms |
Best practise for spring-boot + AWS lambda :
| Aspect | Recommendation |
|---|---|
| Framework | Use Spring Boot (bare minimum) or Micronaut/Quarkus |
| Avoid | Heavy Spring Cloud modules in Lambda |
| Use | Provisioned Concurrency or SnapStart |
| Better Fit | Use Spring Cloud in ECS, EC2, or EKS-based services |
Use case:
We had structured profile data (name, phone, address), so used Amazon RDS (MySQL). Our Spring Cloud Function-based Lambda connects to RDS using JDBC and fetches user data using a simple SELECT query. We expose this via API Gateway as a REST endpoint. This setup leverages schema constraints and relational features of RDS while keeping cold starts optimized via provisioned concurrency and SnapStart (if needed).
// FunctionConfig.java
@Configuration
public class FunctionConfig {
private final JdbcTemplate jdbcTemplate;
public FunctionConfig(DataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
}
@Bean
public Function<Map<String, String>, Map<String, Object>> getProfile() {
return input -> {
String userId = input.get("userId");
try {
return jdbcTemplate.queryForMap(
"SELECT name, phone, address FROM user_profile WHERE id = ?",
userId
);
} catch (EmptyResultDataAccessException e) {
return Map.of("error", "User not found");
}
};
}
}
//Handler
public class LambdaHandler extends SpringBootRequestHandler<Map<String, String>, Map<String, Object>> {}
Amazon S3
- What is S3 Lifecycle Management, and how did you use it?
- Lifecycle rules automate transitions and deletions:
- Moved objects to Standard-IA after 30 days, Glacier after 90 days, and deleted after 365 days.
- Useful for logs, reports, and backup data where older versions are rarely accessed.
- Managed versioned data with separate rules for current and non-current versions.
- Lifecycle rules automate transitions and deletions:
- How did you ensure security for data stored in S3?
- Enabled encryption at rest using SSE-S3 or SSE-KMS for sensitive data.
- Applied bucket policies and IAM roles with least privilege.
- Blocked public access at the account and bucket level.
- Used VPC endpoints for private access without exposing S3 to the internet.
- Enabled object-level logging and AWS Config rules for audit trails.
Amazon DynamoDB
- How is DynamoDB different from Amazon RDS?
| Feature | DynamoDB | RDS (e.g., PostgreSQL) |
|---|---|---|
| Type | NoSQL | Relational SQL |
| Schema | Schema-less | Schema-based |
| Scaling | Auto (serverless/provisioned) | Vertical (read replicas needed) |
| Querying | Key-based + Indexes | Rich SQL support |
| Joins | ❌ Not supported | ✅ Fully supported |
| Use cases | Fast reads, IoT, session data | Reporting, analytics, joins |
- Does DynamoDB have indexes? If yes, what types and how are they used?
- Yes, it supports:
- Primary Index: Partition Key (and optional Sort Key)
- Global Secondary Index (GSI): Alternate PK/SK, used for flexible queries
- Local Secondary Index (LSI): Same PK, different Sort Key
Indexes are critical for enabling non-primary key access patterns.
- Yes, it supports:
- What is partition key ?
- What is TTL in dynamo db?
- TTL automatically deletes expired items using a timestamp field (epoch seconds).
- We used it for sessions, temporary tokens, and cache entries.
- TTL field was named
expiryTimeand enabled at table level. - Combined with DynamoDB Streams to track deletion events.
- TTL automatically deletes expired items using a timestamp field (epoch seconds).
Amazon RDS
- Does Amazon RDS support indexing?
- Yes. RDS supports all traditional index types:
- Primary Key
- Secondary Indexes
- Composite Indexes
- Full-text and functional indexes depending on the engine (e.g., PostgreSQL, MySQL).
We used them to optimize search, filters, and JOIN-heavy queries.
- Yes. RDS supports all traditional index types:
CI/CD on AWS
What CI/CD tools did you use with AWS?
Answer:
- Used CodePipeline + CodeBuild for AWS-native CI/CD.
- Integrated with GitHub Actions and Jenkins to build Docker images.
- Deployed to ECS Fargate, Lambda, or EKS with blue/green or canary deployments.
- Stored artifacts in S3 and container images in ECR.
Backtracking
Backtracking is a general algorithm for finding all (or some) solutions to some computational problems (notably Constraint satisfaction problems or CSPs), which incrementally builds candidates to the solution and abandons a candidate (“backtracks”) as soon as it determines that the candidate cannot lead to a valid solution
AI LLM
Development
- Framework
- Lang-chain
- Terms
- LLM – General knowlege
- RAG -Retrieval Augmented Generation i.e RAG+LLM – Specific information trained
Stream event on job portal – BUIDING LLM Stack for production – By AthinaAI eng by Pathway framework
Storage
- VectorDB
Deployment
Kafka Interview Questions
Questions –
- How do you create a topic in Kafka using the Confluent CLI?
- Command
- Explain the role of the Schema Registry in Kafka.
- How do you register a new schema in the Schema Registry?
- What is the importance of key-value messages in Kafka?
- Describe a scenario where using a random key for messages is beneficial.
- Provide an example where using a constant key for messages is necessary.
- Write a simple Kafka producer code that sends JSON messages to a topic.
- How do you serialize a custom object before sending it to a Kafka topic?
- Describe how you can handle serialization errors in Kafka producers.
- Write a Kafka consumer code that reads messages from a topic and deserializes them from JSON.
- How do you handle deserialization errors in Kafka consumers?
- Explain the process of deserializing messages into custom objects.
- What is a consumer group in Kafka, and why is it important?
- Describe a scenario where multiple consumer groups are used for a single topic.
- How does Kafka ensure load balancing among consumers in a group?
- How do you send JSON data to a Kafka topic and ensure it is properly serialized?
- Describe the process of consuming JSON data from a Kafka topic and converting it to a usable format.
- Explain how you can work with CSV data in Kafka, including serialization and deserialization.
- Write a Kafka producer code snippet that sends CSV data to a topic.
- Write a Kafka consumer code snippet that reads and processes CSV data from a topic.
- Different way to receive and ack the kafka
- What makes kafka fast?
2.Explain the role of the Schema Registry in Kafka.
The Schema Registry in Kafka plays a crucial role in managing schemas for data that is sent to and from Kafka topics.
Schema Management:
- Centralized Schema Repository: The Schema Registry acts as a centralized repository for schemas used in Kafka messages. It stores and manages schemas independently from the Kafka brokers.
- Schema Evolution: It facilitates schema evolution by allowing compatibility checks between different versions of schemas. This ensures that producers and consumers can evolve their schemas without causing disruptions.
Example:
- Suppose a producer wants to publish messages to a Kafka topic using Avro serialization. Before sending data, it registers the Avro schema with the Schema Registry, which assigns it an ID. When the producer sends a message, it includes the schema ID alongside the serialized data. Consumers retrieve the schema ID from the message, fetch the corresponding schema from the Schema Registry, and deserialize the data accordingly.
22.What makes kafka fast?
Zero-copy writes make Kafka fast, but how exactly? ⚡
Kafka is a message broker, and it accepts messages from the network and writes to the disk, and vice versa. The traditional way of moving data from network to disk involves `read` and `write` system calls, which require data to be moved to and from user space to kernel space.
Kafka leverages `sendfile` system call which copies data from one file descriptor to another within the kernel. Kafka uses this to directly transfer data from the network socket to the file on disk, bypassing unnecessary copies.
If you are interested, just read the man page of `sendfile` system call. In most cases, whenever you see something extracting extreme performance a major chunk of it comes from leveraging the right system call.
ps: I used this zero copy while building Remote Shuffle Service for Apache Spark. It proved pivotal in getting a great performance while moving multi-tb data across machines.
⚡ Admissions for my System Design June 2024 cohort are open, if you are SDE-2 and above and looking to build a rock-solid intuition to design any and every system, check out
UBer Usecase –
Java-21 features
Index
- Language feauteres
- String Template
- record pattern
- pattern matching for switch
- Libraries improvement
- Virtual threads
- Sequenced collections
- Performace improvement
- ZGC
String Template[Preview]
Index
- Why Introduced
- syntax
- Usage Example
There are three components to a template expression:
- A processor
- STR Template Processor
- A template which contains the data with the embedded expressions
- e,g, “\{var_name}“
- A dot (.) character
String interpolationUsingSTRProcessor(String feelsLike, String temperature, String unit) {
return STR
. "Today's weather is \{ feelsLike }, with a temperature of \{ temperature } degrees \{ unit }" ;
}
Record pattern
Index
- Why Introduced
- syntax
- Usage Example
Pattern matching for switch
Index
- Why Introduced
- syntax
- Usage Example
Virtual threads
Index
- Why Introduced
- syntax
- Usage Example
Sequenced collections
Index
- Why Introduced
- syntax
- Usage Example
Java-11 features
Index
- var keyword – for local variable representation
- use if var keyword in lambdas
- String class new method
- isEmpty()
- Files class new mwthod
- createDirectories(directory/hireacrchy/to/create)
- Nested class based access control
- HttpClient
Java-17 features
Index
- NullPointerException message enhancement
- Null allowed in switch
- Switch expression enhancement
- switch can come with arrow sign -> which returns a value and
- use of keyword yield to return default value in default section
- multiple cases can be separated by comma
- Sealed classes
- Only permitted class can inherit
- Record class
- reduced boilerplate,
- immutable and final class – they are not extensible.
- No setters
- temporarily hold immutable data i.e traditional POJO