Changejar Technologies
P R L Projects & Infrastructure Interview Questions and Answers
Q1. what happens a primitive data type is passed in a method call and non-primitive data types are passes? when would there be change in value after downstream operation and opposite
Primitive data types are passed by value, while non-primitive data types are passed by reference. Changes in value can occur after downstream operations for non-primitive data types.
Primitive data types (int, float, char, etc.) are passed by value, meaning a copy of the value is passed to the method. Changes made to the parameter inside the method do not affect the original value.
Non-primitive data types (objects, arrays, etc.) are passed by reference, meaning the memory addr...read more
Q2. what are the common annotations used in spring boot
Common annotations used in Spring Boot for backend development
1. @RestController - used to define a controller and to indicate that the return value of the methods should be directly written to the HTTP response body
2. @RequestMapping - used to map web requests to specific handler methods
3. @Autowired - used for automatic dependency injection
4. @Service - used to indicate that a class is a service
5. @Repository - used to indicate that a class is a repository
6. @Component - us...read more
Q3. whats the difference between == and .equal()?
The difference between == and .equal() is that == is used to compare values for equality, while .equal() is a method used to compare objects for equality.
The == operator is used to compare primitive data types like integers, strings, etc. for equality.
The .equal() method is used to compare objects in Java for equality. It is typically overridden in classes to define custom equality logic.
Example: int a = 5; int b = 5; System.out.println(a == b); // true
Example: String str1 = ...read more
Q4. Is Javascript multithreaded or single threaded
Javascript is single threaded.
Javascript is single threaded, meaning it can only execute one piece of code at a time.
This is because of the event loop in Javascript, which manages the execution of code.
Asynchronous operations in Javascript, like setTimeout or AJAX requests, are handled by the event loop.
Web Workers can be used to achieve multithreading in Javascript for CPU-intensive tasks.
Q5. Stream API, advantages and uses
Stream API is a powerful tool in Java for processing collections of objects.
Advantages include concise code, improved performance, and ease of parallel processing.
Uses include filtering, mapping, sorting, and reducing data in collections.
Example: stream.filter(x -> x > 5).map(x -> x * 2).collect(Collectors.toList());
Q6. DB Schema of one of my project
The DB schema of my project includes tables for users, products, orders, and reviews.
Users table with columns for user ID, username, email, password
Products table with columns for product ID, name, price, description
Orders table with columns for order ID, user ID, product ID, quantity
Reviews table with columns for review ID, product ID, user ID, rating, comment
Q7. Reverse a string
Reverse a string by iterating through the characters and swapping them
Create an empty string to store the reversed string
Iterate through the characters of the input string from end to start
Append each character to the empty string to reverse the string
Interview Process at P R L Projects & Infrastructure
Reviews
Interviews
Salaries
Users/Month