Premium Employer

Info Edge

4.0
based on 1.9k Reviews
Filter interviews by

50+ Java R & D Interview Questions and Answers

Updated 2 Sep 2024
Popular Designations
Q1. Break The Integer

Ninja is given an integer ‘N’ . One day Ninja decides to break the integer into K positive parts (K>=2) such that the sum of all parts is equal to ‘N’.Ninja wants to maximize the product of al...read more

View 4 more answers
Q2. Triplets with Given Sum

You are given an array/list ARR consisting of N integers. Your task is to find all the distinct triplets present in the array which adds up to a given number K.

An array is said to have a...read more

View 3 more answers
Q3. Balanced parentheses

Given an integer ‘N’ representing the number of pairs of parentheses, Find all the possible combinations of balanced parentheses with the given number of pairs of parentheses.

Note :

Conditi...read more
View 2 more answers

Q4. Write the code for rearranging the array in consecutive pair multiplication. For example consider an array with 10 element A0, A1, A2......A9. The resultant array will be A0*A1, A1*A2, A2*A3, and so on. The fin...

read more
Ans.

Rearrange array in consecutive pair multiplication in descending order.

  • Create a new array to store the multiplied values

  • Use a loop to iterate through the original array and multiply consecutive pairs

  • Write a compare function to sort the new array in descending order

Add your answer
Discover Java R & D interview dos and don'ts from real experiences
Q5. Puzzle

How many times in a day do the two hands on a clock coincide?

Add your answer

Q6. Q: What is a Transaction in DBMS and ACID properties? Q: What is Thread and how it is different from the Process? Q: What are some Linux commands. Write any 5 commands? Q: Why sudo is used for commands? Q: Linu...

read more
Ans.

Answers to common technical questions in a software engineering interview

  • A transaction in DBMS is a sequence of operations that must be treated as a single unit of work. ACID properties ensure reliability and consistency of transactions.

  • A thread is a lightweight process that shares memory and resources with other threads in the same process. A process is a separate instance of a program.

  • Common Linux commands include ls, cd, mkdir, rm, and grep.

  • sudo is used to run commands wit...read more

Add your answer
Are these interview questions helpful?

Q7. System design of BookMyShow. Design the algorithm and database for the seat booking system. How this the system will handle the case when the payment gets failed. Again he asked me to write the query for the ti...

read more
Ans.

Design algorithm and database for seat booking system of BookMyShow and handle failed payments.

  • Create a database with tables for movies, theaters, seats, bookings, and payments

  • Use a locking mechanism to prevent double booking of seats

  • If payment fails, release the locked seats and notify the user

  • Write a query to get the timestamp in SQL: SELECT CURRENT_TIMESTAMP;

Add your answer

Q8. How would you introduce a new version of an API without breaking the previous one?

Ans.

Introduce new API version without breaking the previous one.

  • Use versioning in the API endpoint URL

  • Provide documentation for both versions

  • Gradually phase out the old version

  • Use backward-compatible changes

  • Test thoroughly before releasing the new version

Add your answer
Share interview questions and help millions of jobseekers 🌟
Q9. Networking Question

What happens when you enter Google.com on the web browser.

Add your answer

Q10. To write a program which can divide, multiply, subtract and add two fractional number and give solution in simplest fraction form. Every fractional number should be consider as an object.

Ans.

A program to perform basic arithmetic operations on fractional numbers and simplify the result.

  • Create a Fraction class with numerator and denominator attributes

  • Implement methods for addition, subtraction, multiplication, and division

  • Use the Euclidean algorithm to simplify the result

  • Handle edge cases such as dividing by zero or negative denominators

Add your answer
Q11. Node Js Question

Why Node.js is a single threaded language ?

View 2 more answers

Q12. Build a pyramid pattern of numbers in O(n) time using any language.

Ans.

Print a pyramid pattern of numbers in O(n) time.

  • Use nested loops to print the pattern.

  • The outer loop will iterate from 1 to n.

  • The inner loop will iterate from 1 to the current value of the outer loop.

  • Print the inner loop variable and a space after each iteration.

  • Print a new line after the inner loop completes.

Add your answer

Q13. How would you use your Data structures and algorithms knowledge in managing the working of a server?

Ans.

Data structures and algorithms can be used to optimize server performance and improve scalability.

  • Implement efficient data structures for storing and accessing data on the server

  • Use algorithms to optimize server processes and reduce response times

  • Implement caching algorithms to improve performance and reduce server load

  • Use data structures to manage server resources and prioritize tasks

  • Implement load balancing algorithms to distribute traffic evenly across multiple servers

Add your answer

Q14. Write a program to evaluate an algebraic expression e.x. (x+y-z) where the values of x,y,z are already provided to you

Ans.

Program to evaluate algebraic expression with given values

  • Use a stack to keep track of operators and operands

  • Iterate through the expression and push operands onto the stack

  • When an operator is encountered, pop the top two operands and perform the operation

  • Push the result back onto the stack

  • Repeat until the entire expression has been evaluated

Add your answer

Q15. Write a program to find all the elements which are present in one array but not in other array.

Ans.

Program to find elements present in one array but not in other array

  • Iterate through each element in the first array and check if it exists in the second array

  • If not found, add it to a new array of unique elements

  • Repeat the process for the second array to find elements unique to it

Add your answer

Q16. How do you decide which type of tech stack to use?

Ans.

Tech stack selection depends on project requirements, team expertise, scalability, and budget.

  • Analyze project requirements and choose a stack that fits best

  • Consider team expertise and choose a stack that team is comfortable with

  • Evaluate scalability requirements and choose a stack that can handle future growth

  • Consider budget constraints and choose a stack that is cost-effective

  • Research and compare different stacks to make an informed decision

Add your answer

Q17. Why have you chosen NodeJS for building your projects?

Ans.

NodeJS is fast, scalable and has a large community support.

  • NodeJS is built on Chrome's V8 JavaScript engine which makes it fast and efficient.

  • It is event-driven and non-blocking which makes it scalable for handling large amounts of data.

  • NodeJS has a large community support with a vast number of libraries and modules available.

  • It is also cross-platform compatible and can be used for both server-side and client-side development.

  • Examples of popular NodeJS projects include Netfli...read more

Add your answer

Q18. What is stoi function (stoi() function)? Its uses and code to Implement stoi function.

Ans.

stoi() function converts a string to an integer.

  • stoi() is a C++ function that takes a string as input and returns an integer.

  • It is used to convert a string of digits into an integer.

  • It can also handle negative numbers and ignore leading whitespace.

  • Example: int num = stoi("123"); // num is now 123

Add your answer
Q19. React Question

What is virtual DOM?

Add your answer

Q20. Find minimum number of coins that make a given value using backtracking and dynamic programming both.

Ans.

Find minimum number of coins for a given value using backtracking and dynamic programming.

  • Backtracking involves exploring all possible solutions and choosing the best one.

  • Dynamic programming involves breaking down the problem into smaller subproblems and solving them.

  • For backtracking, we can start with the largest coin and keep subtracting it until we reach the target value.

  • For dynamic programming, we can create a table to store the minimum number of coins needed for each val...read more

Add your answer

Q21. Write a program to find the largest palindromic substring in the input string.

Ans.

Program to find the largest palindromic substring in input string.

  • Iterate through each character in the input string and check for palindromic substrings.

  • Keep track of the largest palindromic substring found so far.

  • Use dynamic programming or expand around center approach for efficient solution.

  • Example: Input string 'babad', largest palindromic substring is 'bab' or 'aba'.

Add your answer
Q22. Node Js Question

What is Event Loop?

Add your answer

Q23. Write a program to find all triplets with a given sum.

Ans.

Program to find all triplets with a given sum in an array.

  • Use three nested loops to iterate through all possible combinations of triplets.

  • Check if the sum of the current triplet is equal to the given sum.

  • Store the triplets that satisfy the condition in a list and return the list.

Add your answer

Q24. Write a program to evaluate a mathematical expression (stack was involved).

Ans.

Program to evaluate a mathematical expression using stack

  • Use a stack to store operands and operators

  • Iterate through the expression and push operands onto the stack

  • When an operator is encountered, pop operands from the stack, perform the operation, and push the result back onto the stack

  • Continue until the entire expression is evaluated

  • The final result will be the top element of the stack

Add your answer
Q25. React Question

Explain the updating phase of React lifecycle.

Add your answer
Q26. OS Question

Difference between process and thread

Add your answer
Q27. CSS Question

How to center a div?

Add your answer
Q28. Networking Question

Explain different OSI Layers

Add your answer

Q29. To write a program which will detect repeated word sequences.

Ans.

Program to detect repeated word sequences

  • Read input text and split into words

  • Create a dictionary to store word sequences and their frequency

  • Iterate through the words and check for repeated sequences

  • Output the repeated sequences and their frequency

Add your answer

Q30. Write code for Longest Common Substring. (time limit for writing this code was 5-6 minutes)

Ans.

Code for finding the longest common substring in an array of strings.

  • Iterate through the first string and check for all possible substrings

  • Check if the substring is present in all other strings

  • Keep track of the longest common substring found so far

  • Return the longest common substring

Add your answer

Q31. What are the SEO standards that one needs to follow?

Ans.

SEO standards include optimizing website content, using relevant keywords, and building quality backlinks.

  • Optimize website content with relevant keywords and meta tags

  • Ensure website is mobile-friendly and has fast loading speed

  • Build quality backlinks from reputable sources

  • Use descriptive and unique page titles and URLs

  • Regularly update website content and add new pages

  • Avoid duplicate content and keyword stuffing

  • Utilize social media to promote website and increase visibility

Add your answer

Q32. How is an arrow function different from a normal function?

Ans.

Arrow functions are shorter syntax for writing function expressions.

  • Arrow functions do not have their own 'this' keyword.

  • They cannot be used as constructors.

  • They cannot be used as methods in objects.

  • They have implicit return statements.

  • They have a more concise syntax than normal functions.

Add your answer

Q33. what is web server and application server

Ans.

Web server handles HTTP requests and responses, while application server executes application logic.

  • Web server serves static content like HTML, CSS, JS files

  • Application server executes dynamic code like Java, Python, Ruby

  • Web server communicates with client, application server communicates with database

  • Examples of web servers: Apache, Nginx, IIS

  • Examples of application servers: Tomcat, JBoss, WebSphere

Add your answer

Q34. What are higher-order components in React?

Ans.

Higher-order components are functions that take a component and return a new component with additional functionality.

  • Higher-order components (HOCs) are a pattern in React for reusing component logic.

  • They are functions that take a component and return a new component with additional functionality.

  • HOCs can be used for adding props, state, or lifecycle methods to a component.

  • Examples of HOCs include connect() from React Redux and withRouter() from React Router.

Add your answer

Q35. What are the pillars of OOPS?

Ans.

The pillars of OOPS are Abstraction, Encapsulation, Inheritance, and Polymorphism.

  • Abstraction: Hiding implementation details and showing only necessary information.

  • Encapsulation: Binding data and functions together and restricting access to them.

  • Inheritance: Creating new classes from existing ones, inheriting properties and methods.

  • Polymorphism: Ability of objects to take on multiple forms and behave differently based on context.

View 1 answer

Q36. Arrange a string based on the frequency of the characters

Ans.

The question asks to arrange a string based on the frequency of the characters.

  • Create a dictionary to store the frequency of each character in the string.

  • Sort the dictionary based on the frequency of characters in descending order.

  • Create a new string by concatenating the characters in the sorted dictionary.

Add your answer

Q37. Build a system for College Fest Management.

Ans.

A system for managing college fests

  • Create a website for event registration and ticketing

  • Develop a mobile app for real-time updates and notifications

  • Implement a database to store event details and participant information

  • Integrate payment gateway for online transactions

  • Include features for event scheduling, venue management, and volunteer coordination

Add your answer

Q38. Write the code to rearrange the array in maximum-minimum form.

Ans.

Code to rearrange an array in maximum-minimum form.

  • Sort the array in descending order.

  • Create a new array and alternate between adding the maximum and minimum values from the sorted array.

  • Return the new array.

  • Time complexity: O(nlogn)

  • Space complexity: O(n)

Add your answer

Q39. Find the sum of k smallest number in a BST.

Ans.

Find sum of k smallest numbers in a BST.

  • Traverse the BST in-order and add the k smallest numbers to a sum variable.

  • Use a priority queue to keep track of the k smallest numbers.

  • If k is greater than the number of nodes in the BST, return the sum of all nodes.

  • If k is 0, return 0.

Add your answer

Q40. Search an element In a rotated sorted array.

Ans.

Search an element in a rotated sorted array.

  • Find the pivot point where the array is rotated

  • Determine which half of the array the target element is in

  • Perform binary search on that half of the array

  • Handle edge cases such as duplicates and empty arrays

Add your answer

Q41. What is meant by code splitting?

Ans.

Code splitting is a technique to split code into smaller chunks to improve performance.

  • Code is divided into smaller chunks that can be loaded on demand

  • Reduces initial load time and improves performance

  • Used in modern web development frameworks like React, Angular, and Vue

  • Example: splitting a large JavaScript file into smaller modules

Add your answer

Q42. Write the code for the time stamp in C.

Ans.

Code for time stamp in C

  • Use the time.h header file

  • Call the time() function to get the current time in seconds

  • Convert the time to a string using strftime() function

  • Use the format string to specify the desired format of the time stamp

Add your answer

Q43. Addition of 2 numbers represented by Linked List

Ans.

Addition of 2 numbers represented by Linked List

  • Traverse both linked lists simultaneously and add the corresponding nodes

  • If the sum is greater than 9, carry over the 1 to the next node

  • If one linked list is shorter than the other, pad it with 0's

  • Return the sum as a new linked list

Add your answer

Q44. What is tree shaking in React?

Ans.

Tree shaking is a process of eliminating unused code in React applications.

  • It is a part of the build process that removes dead code from the final bundle.

  • It helps in reducing the size of the bundle and improving the performance of the application.

  • It works by analyzing the code and identifying the parts that are not used.

  • It is achieved through tools like webpack and babel.

  • Example: If a component is not used in the application, tree shaking will remove it from the final bundle.

Add your answer

Q45. How to cope with stress?

Ans.

To cope with stress, it is important to practice self-care, seek support from others, and engage in stress-relieving activities.

  • Practice self-care by getting enough sleep, eating well, and exercising regularly.

  • Seek support from friends, family, or a therapist to talk about your feelings and get advice.

  • Engage in stress-relieving activities such as meditation, yoga, or hobbies you enjoy.

  • Set boundaries and prioritize tasks to avoid feeling overwhelmed.

  • Take breaks and practice re...read more

Add your answer

Q46. NoSQL vs SQL databases

Ans.

NoSQL databases are non-relational and flexible, while SQL databases are relational and structured.

  • NoSQL databases are better suited for handling unstructured data

  • SQL databases are better suited for handling structured data

  • NoSQL databases are horizontally scalable

  • SQL databases are vertically scalable

  • Examples of NoSQL databases include MongoDB and Cassandra

  • Examples of SQL databases include MySQL and PostgreSQL

Add your answer

Q47. Linked List reversal in groups of k

Ans.

Reverses a linked list in groups of k

  • Break the linked list into groups of k nodes

  • Reverse each group individually

  • Connect the reversed groups back together

Add your answer

Q48. Reverse a linked list

Ans.

Reverse a linked list

  • Iteratively swap the next and previous pointers of each node

  • Use three pointers to keep track of the current, previous, and next nodes

  • Update the head pointer to the last node after reversing

Add your answer

Q49. Topological Sort Implementation

Ans.

Topological sort is a linear ordering of vertices in a directed acyclic graph.

  • Topological sort is used to find a linear ordering of vertices in a directed acyclic graph.

  • It is commonly implemented using depth-first search (DFS) algorithm.

  • The algorithm starts by visiting a vertex and then recursively visits all its adjacent vertices before adding it to the result list.

  • Topological sort is not possible if the graph has cycles.

Add your answer

Q50. Describe about a topic

Ans.

Topic description

  • Pointer 1

  • Pointer 2

  • Pointer 3

Add your answer

Q51. Topological sorting in graph

Ans.

Topological sorting is a linear ordering of vertices in a directed acyclic graph where for every directed edge uv, vertex u comes before v.

  • Topological sorting is used in scheduling tasks, such as in project management or task scheduling algorithms.

  • It can be implemented using depth-first search (DFS) algorithm.

  • Kahn's algorithm is another popular method for topological sorting.

  • Example: Given a graph with vertices A, B, C and directed edges A->B, A->C, B->C, the topological sort...read more

Add your answer

Q52. Palindrome of string

Ans.

A palindrome of a string is a word, phrase, number, or other sequence of characters that reads the same forward and backward.

  • Check if the string is equal to its reverse to determine if it is a palindrome.

  • Ignore spaces and punctuation when checking for palindromes.

  • Examples: 'racecar', 'madam', 'A man, a plan, a canal, Panama!'

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Java R & D

based on 8 interviews in the last 1 year
2 Interview rounds
Coding Test Round
Technical Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Engineer Interview Questions from Similar Companies

3.8
 • 22 Interview Questions
3.5
 • 17 Interview Questions
3.6
 • 16 Interview Questions
3.1
 • 15 Interview Questions
2.0
 • 10 Interview Questions
4.0
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter