Enfec Solutions
Ashoka Mart Interview Questions and Answers
Q1. Given an array and index value rotate the array
Rotate an array of strings based on given index value
Create a new array and copy elements starting from the given index to the end
Copy elements from the start of the original array to the given index to the new array
Combine the two arrays to get the rotated array
Q2. Rest api integration with rest template
Rest template is used to consume RESTful web services in Spring Boot applications.
RestTemplate is a class provided by Spring Framework to make RESTful web service calls.
It simplifies the process of consuming RESTful web services by handling the HTTP requests and responses.
You can use RestTemplate to make GET, POST, PUT, DELETE requests to RESTful APIs.
Example: RestTemplate restTemplate = new RestTemplate(); ResponseEntity
response = restTemplate.getForEntity(url, String.class...read more
Q3. 2. What is autowired
Autowired is a feature in Spring Framework that allows automatic dependency injection.
Autowired annotation is used to automatically wire beans by type.
It eliminates the need for explicit bean configuration in XML or Java configuration.
Autowired can be used on properties, setters, and constructors.
Example: @Autowired private UserService userService;
Q4. 1. Create rest apis.
Creating REST APIs involves designing endpoints, defining request and response formats, implementing CRUD operations, and handling authentication and authorization.
Design endpoints based on resource hierarchy and actions (GET, POST, PUT, DELETE)
Define request and response formats using JSON or XML
Implement CRUD operations for each endpoint (Create, Read, Update, Delete)
Handle authentication and authorization using tokens or API keys
Use frameworks like Express.js for Node.js o...read more
Q5. 3 palindromic string
A palindromic string is a string that reads the same forwards and backwards.
Create a function to check if a string is a palindrome by comparing characters from start and end of the string.
Examples: 'racecar', 'level', 'madam'
Q6. How spring security works and hibernate and JPA
Spring Security provides authentication and authorization for Java applications, while Hibernate and JPA are used for ORM in database operations.
Spring Security provides authentication (login) and authorization (access control) for Java applications.
Hibernate is an ORM (Object-Relational Mapping) framework that simplifies database operations in Java applications.
JPA (Java Persistence API) is a specification for ORM in Java applications, with Hibernate being one of its impleme...read more
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month