JPMorgan Chase & Co.
Royal Deep Construction Interview Questions and Answers
Q1. What is the difference between abstract class and interface? Give a use case for both.
Abstract class allows partial implementation while interface allows full abstraction.
Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.
A class can only extend one abstract class, but can implement multiple interfaces.
Abstract class is used when some common functionality needs to be shared among subclasses, while interface is used to define a contract for classes to implement.
Example: Abstract class 'Shape' with abst...read more
Q2. What is TDD and BDD? What are the differences and which one do you prefer?
TDD stands for Test-Driven Development and BDD stands for Behavior-Driven Development. TDD focuses on writing tests before writing code, while BDD focuses on the behavior of the system.
TDD involves writing a failing test, writing code to make the test pass, and then refactoring the code.
BDD focuses on defining the behavior of the system through examples written in a specific format like Given-When-Then.
TDD is more developer-centric, while BDD involves collaboration between de...read more
Q3. What has been your experience with framework design and implementation?
I have extensive experience in designing and implementing frameworks for various software projects.
Designed and implemented a custom testing framework for automated testing of web applications.
Utilized Spring framework for developing enterprise applications, including dependency injection and aspect-oriented programming.
Contributed to the design and implementation of a microservices architecture using Netflix OSS frameworks like Eureka and Zuul.
Q4. Write a program to find the frequency of word in a sentence
Program to find frequency of words in a sentence
Split the sentence into words using space as delimiter
Create a map to store word frequencies
Iterate through the words and update the map accordingly
Handle case sensitivity and punctuation if needed
Q5. Write a program to check if the sum of digits of.the given number is a prime number
Program to check if sum of digits of a number is prime
Convert the number to a string to iterate through each digit
Calculate the sum of digits
Check if the sum is a prime number
Q6. Write an SQL query to get the second highest salary in the table
SQL query to get the second highest salary in a table
Use the MAX() function to find the highest salary
Use the WHERE clause to exclude the highest salary
Order the salaries in descending order and limit the result to 1
Q7. Where are objects stored in memory?
Objects are stored in memory in the heap or stack depending on their scope and lifetime.
Objects with local scope are stored on the stack, while objects with dynamic memory allocation are stored on the heap.
Primitive data types like int, float are stored on the stack, while complex objects like arrays, classes are stored on the heap.
Objects stored on the stack have faster access but limited size, while objects on the heap have slower access but can grow dynamically.
Q8. What is the difference between var let and const?
var, let, and const are all used for variable declaration in JavaScript, but they have different scopes and mutability.
var is function-scoped and can be redeclared and reassigned
let is block-scoped and can be reassigned but not redeclared
const is block-scoped and cannot be reassigned or redeclared
Q9. Explain static and give it's use case.
Static keyword is used in programming to declare variables or methods that belong to the class itself, rather than instances of the class.
Static variables are shared among all instances of a class.
Static methods can be called without creating an instance of the class.
Static keyword is used to define constants in a class.
Static keyword is used in Java, C++, and other programming languages.
More about working at JPMorgan Chase & Co.
Interview Process at Royal Deep Construction
Reviews
Interviews
Salaries
Users/Month