Info Edge
50+ Java R & D Interview Questions and Answers
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
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
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
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 moreRearrange 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
How many times in a day do the two hands on a clock coincide?
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 moreAnswers 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
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 moreDesign 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;
Q8. How would you introduce a new version of an API without breaking the previous one?
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
What happens when you enter Google.com on the web browser.
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.
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
Why Node.js is a single threaded language ?
Q12. Build a pyramid pattern of numbers in O(n) time using any language.
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.
Q13. How would you use your Data structures and algorithms knowledge in managing the working of a server?
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
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
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
Q15. Write a program to find all the elements which are present in one array but not in other array.
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
Q16. How do you decide which type of tech stack to use?
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
Q17. Why have you chosen NodeJS for building your projects?
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
Q18. What is stoi function (stoi() function)? Its uses and code to Implement stoi function.
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
Q20. Find minimum number of coins that make a given value using backtracking and dynamic programming both.
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
Q21. Write a program to find the largest palindromic substring in the input string.
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'.
Q23. Write a program to find all triplets with a given sum.
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.
Q24. Write a program to evaluate a mathematical expression (stack was involved).
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
Explain the updating phase of React lifecycle.
Difference between process and thread
Explain different OSI Layers
Q29. To write a program which will detect repeated word sequences.
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
Q30. Write code for Longest Common Substring. (time limit for writing this code was 5-6 minutes)
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
Q31. What are the SEO standards that one needs to follow?
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
Q32. How is an arrow function different from a normal function?
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.
Q33. what is web server and application server
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
Q34. What are higher-order components in React?
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.
Q35. What are the pillars of OOPS?
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.
Q36. Arrange a string based on the frequency of the characters
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.
Q37. Build a system for College Fest Management.
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
Q38. Write the code to rearrange the array in maximum-minimum form.
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)
Q39. Find the sum of k smallest number in a BST.
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.
Q40. Search an element In a rotated sorted array.
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
Q41. What is meant by code splitting?
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
Q42. Write the code for the time stamp in C.
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
Q43. Addition of 2 numbers represented by Linked List
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
Q44. What is tree shaking in React?
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.
Q45. How to cope with stress?
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
Q46. NoSQL vs SQL databases
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
Q47. Linked List reversal in groups of k
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
Q48. Reverse a linked list
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
Q49. Topological Sort Implementation
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.
Q50. Describe about a topic
Topic description
Pointer 1
Pointer 2
Pointer 3
Q51. Topological sorting in graph
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
Q52. Palindrome of string
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!'
Top HR Questions asked in Java R & D
Interview Process at Java R & D
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month