Oracle
20+ Amara Raja Infra Interview Questions and Answers
Q1. Find missing and repeating element in an array of 1 to n elements. N is the size of array. Solve in O-n time and O-1 space.
Find missing and repeating element in an array of 1 to n elements in O(n) time and O(1) space.
Iterate through the array and for each element, mark the element at index equal to its value as negative. If the element is already negative, it is the repeating element.
After marking all elements, the positive element's index + 1 is the missing element.
Example: Array ['1', '2', '3', '3', '5'] - Repeating element is '3' and missing element is '4'.
Q2. Write code on multi threaded example? Like create two threads and synchronised them.
Creating two threads and synchronizing them in a multi-threaded example.
Create two threads using the Thread class in Java.
Implement the run() method for each thread.
Use synchronized keyword to ensure thread safety.
Example: Thread t1 = new Thread(new MyRunnable()); t1.start();
Example: Thread t2 = new Thread(new MyRunnable()); t2.start();
Q3. All c++ core concepts and oops concept. Find second greatest element in an array without sorting.
Find the second greatest element in an array without sorting using C++ concepts.
Iterate through the array to find the greatest element.
While iterating, keep track of the second greatest element.
Return the second greatest element once the iteration is complete.
Q4. Count nodes in a binary tree without using recursion
Count nodes in a binary tree without using recursion
Use a stack to keep track of nodes to visit
Pop nodes from the stack and increment count for each node visited
Continue until stack is empty
Q5. Longest non repeating subsequence in a string
Find the longest subsequence in a string without repeating characters.
Use a sliding window approach to keep track of the characters seen so far.
Update the start index of the window when a repeating character is encountered.
Keep track of the longest subsequence length seen so far.
Q6. 1. Write code for producer consumer problem.
Producer consumer problem solution code
Use synchronized keyword or locks to ensure thread safety
Use wait() and notify() methods to coordinate between producer and consumer threads
Use a shared buffer to store data produced by producer and consumed by consumer
Example: https://www.geeksforgeeks.org/producer-consumer-solution-using-threads-java/
Q7. Rotate k elements to the right in an array
Rotate k elements to the right in an array
Create a new array with the same length as the original array
Copy elements from the original array to the new array starting from index (k % array length)
Copy remaining elements from the original array to the new array
Return the new array as the rotated array
Q8. Longest Palindromic Substring in a given String
Find the longest palindromic substring in a given string.
Use dynamic programming to check if substrings are palindromes.
Start with single characters as potential palindromes and expand outwards.
Keep track of the longest palindrome found so far.
Q9. Merge two sorted LinkedList into a Sorted LinkedList.
Merge two sorted LinkedList into a Sorted LinkedList.
Create a new LinkedList to store the merged result.
Iterate through both input LinkedLists and compare values to insert into the new LinkedList.
Handle cases where one LinkedList is longer than the other.
Time complexity should be O(m+n) where m and n are the lengths of the input LinkedLists.
Q10. Consumer producer multithreading program.
Consumer producer multithreading program involves multiple threads sharing a common buffer to produce and consume data.
Use synchronized data structures like BlockingQueue to handle thread synchronization.
Implement separate producer and consumer classes with run methods.
Use wait() and notify() methods to control the flow of data between producer and consumer threads.
Q11. What is expected compensation
Expected compensation should be based on industry standards, experience, skills, and location.
Research industry standards for Senior Software Engineer salaries
Consider your level of experience and skills
Take into account the cost of living in the location of the job
Negotiate based on your value to the company
Q12. Sort an integer array with only 0 and 1
Sort an integer array with only 0 and 1
Iterate through the array and count the number of 0s and 1s
Update the array with the correct number of 0s and 1s based on the counts
Time complexity should be O(n)
Q13. System design for the last project
Implemented a microservices architecture using Docker and Kubernetes for scalability and reliability.
Used Docker containers to encapsulate each microservice for easy deployment and scaling.
Utilized Kubernetes for automated container orchestration and management.
Implemented service discovery and load balancing for seamless communication between microservices.
Q14. What is inheritance in oops
Inheritance in OOP allows a class to inherit properties and behaviors from another class.
Inheritance promotes code reusability by allowing a new class to use the properties and methods of an existing class.
The class that is being inherited from is called the base class or parent class, while the class that inherits is called the derived class or child class.
Derived classes can add new properties and methods, or override existing ones from the base class.
Example: class Animal ...read more
Q15. System design for small systems
System design for small systems involves creating a high-level architecture to meet specific requirements.
Identify the requirements and constraints of the system
Break down the system into smaller components/modules
Design the interactions between components
Consider scalability, reliability, and performance
Choose appropriate technologies and frameworks
Document the design for future reference
Q16. Write code for atoi function
Code for atoi function
Loop through the string and convert each character to its integer value
Multiply the current result by 10 and add the integer value of the current character
Handle negative numbers and invalid input
Q17. System design of command service
System design of command service involves designing a system that can handle and execute commands efficiently.
Define the requirements for the command service, including supported commands and expected response times.
Design a scalable architecture that can handle a large number of concurrent commands.
Implement a command queue to manage the order of execution and prevent conflicts.
Consider implementing a retry mechanism for failed commands to ensure reliability.
Use appropriate ...read more
Q18. Sort the array of 0,1,2
Sort an array of strings containing '0', '1', and '2'.
Use counting sort algorithm to count the occurrences of '0', '1', and '2'.
Create a new array based on the counts of each element.
Return the sorted array.
Q19. Design quick ecommerce site.
Designing a quick ecommerce site involves creating a user-friendly interface with easy navigation and secure payment options.
Focus on a clean and intuitive user interface
Implement a robust search functionality for products
Include secure payment gateways like PayPal or Stripe
Optimize site speed for quick loading times
Ensure mobile responsiveness for on-the-go shopping
Integrate customer reviews and ratings for trust-building
Implement a user-friendly checkout process with guest ...read more
Q20. Write polyfill for array map
Polyfill for array map function in JavaScript
Create a function called myMap that takes a callback function as an argument
Loop through the array and apply the callback function to each element
Return a new array with the results of the callback function applied to each element
Q21. Direction of moves.
The question is likely asking about the direction of movement in a software project or codebase.
Discuss the importance of having a clear direction in software development.
Explain how changes in direction can impact project timelines and outcomes.
Provide examples of how effective communication and planning can help maintain a consistent direction in a project.
More about working at Oracle
Interview Process at Amara Raja Infra
Top Senior Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month