Nagarro
10+ BlogVault Interview Questions and Answers
Q1. Suppose we have more 2 interfaces with the same default method. What will happen when we try to implment both the interfaces in the same class.?
The class will have to provide its own implementation of the conflicting default method.
When implementing multiple interfaces with the same default method, a class must provide its own implementation of the conflicting method.
The class cannot inherit the default implementation from both interfaces.
The class can choose to implement one of the default methods and provide its own implementation for the other.
Alternatively, the class can provide a completely new implementation fo...read more
Q2. What are the different types of data binding in Angular?
Data binding in Angular allows automatic synchronization of data between the model and the view.
Interpolation: {{ }} - binds data from the component to the view
Property binding: [] - binds data from the component to an element property
Event binding: () - binds an event from the view to a method in the component
Two-way binding: [()] - combines property and event binding to achieve two-way data flow
Q3. When to use Inline Template vs External Template in Angular?
Inline templates are used for small, simple templates, while external templates are used for larger, complex templates.
Inline templates are defined within the component's TypeScript file using the template property.
External templates are defined in separate HTML files and linked to the component using the templateUrl property.
Inline templates are useful for small components or when the template is simple and doesn't require much HTML code.
External templates are beneficial for...read more
Q4. What are the two types of compiler in angular?
The two types of compiler in Angular are JIT (Just-in-Time) compiler and AOT (Ahead-of-Time) compiler.
JIT compiler compiles the code at runtime in the browser.
AOT compiler compiles the code before the application is deployed to the browser.
JIT compilation is slower but allows for faster development and debugging.
AOT compilation is faster but requires additional build step before deployment.
Q5. Which module is used for http calls in Angular?
HttpClient module is used for http calls in Angular.
HttpClient module is part of the @angular/common/http package.
It provides a simplified API for making HTTP requests.
It supports various HTTP methods like GET, POST, PUT, DELETE, etc.
It also supports features like request/response headers, query parameters, error handling, etc.
Example: import { HttpClient } from '@angular/common/http';
Q6. What are projections in Spring Data JPA?
Projections in Spring Data JPA allow customizing the shape of the data returned from a query.
Projections are used to retrieve specific fields or a subset of fields from an entity.
They help in reducing the amount of data transferred over the network.
Projections can be defined using interfaces or classes.
They can be used with both JPQL and native SQL queries.
Projections can be used to fetch related entities as well.
Q7. Terminal vs Intermediate Operations in streams
Terminal operations in streams produce a result or a side effect, while intermediate operations transform or filter the data.
Terminal operations are the final operations in a stream pipeline, such as forEach, collect, or reduce.
Intermediate operations are operations that can be chained together, such as filter, map, or sorted.
Terminal operations trigger the processing of the stream and produce a result or a side effect.
Intermediate operations transform or filter the data in t...read more
Q8. Implement custom array listin java
Custom implementation of ArrayList in Java
Create a class with an array to store elements
Implement methods like add, get, remove, size, etc.
Handle resizing of the array when needed
Example: CustomArrayList
list = new CustomArrayList<>();
Q9. try vs try-with-resources
try vs try-with-resources
The 'try' statement is used to define a block of code to be tested for exceptions.
The 'try-with-resources' statement is used to automatically close resources that implement the AutoCloseable interface.
Try-with-resources is more concise and less error-prone compared to try-catch-finally.
Try-with-resources can handle multiple resources in a single statement.
Q10. Iterator vs ListIterator
Iterator is a universal interface for iterating over a collection, while ListIterator is a specialized interface for iterating over lists.
Iterator can only move forward, while ListIterator can move in both directions.
ListIterator has additional methods like previous(), hasPrevious(), and add().
ListIterator is only available for List implementations, while Iterator can be used with any collection.
Q11. Promises vs Observables
Promises are used for asynchronous programming in JavaScript, while Observables are used for reactive programming.
Promises represent a single value that may be available now or in the future.
Observables represent a stream of values that can be emitted over time.
Promises are eager, meaning they start executing as soon as they are created.
Observables are lazy, meaning they only start executing when subscribed to.
Promises can be chained using .then() to handle success or failure...read more
Q12. Constructor vs ngOnInit
Constructor is a special method used to initialize an object, while ngOnInit is a lifecycle hook in Angular.
Constructor is used to create and initialize an object of a class.
ngOnInit is a lifecycle hook in Angular that is called after the component is initialized.
Constructor is defined using the constructor keyword, while ngOnInit is a method defined in the component class.
Constructor is called only once during the creation of an object, while ngOnInit is called every time th...read more
More about working at Nagarro
Top Java Full Stack Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month