i
Synechron
Filter interviews by
A class is a blueprint or template for creating objects, while an object is an instance of a class.
A class defines the properties and behaviors of objects, while an object is a specific instance of a class.
Classes can be used to create multiple objects with similar characteristics.
Objects have state (attributes) and behavior (methods) defined by the class.
Example: Class 'Car' defines properties like 'color' and 'm...
Reversing a linked list involves changing the direction of the pointers between nodes.
Iterative Approach: Use three pointers (prev, current, next) to reverse links.
Example: For list 1 -> 2 -> 3, after reversal it becomes 3 -> 2 -> 1.
Recursive Approach: Reverse the rest of the list and adjust pointers.
Example: Base case when current is null, then set head to prev.
Producer-consumer problem is a classic synchronization problem in multithreading.
Use wait() and notify() methods for synchronization
Create a shared buffer to store data between producer and consumer
Ensure proper handling of synchronization to avoid race conditions
Singleton is a design pattern in Java where a class is restricted to have only one instance.
Singleton pattern ensures that a class has only one instance and provides a global point of access to it.
It is commonly used in scenarios where a single instance of a class is required to control actions throughout a system.
Example: Database connection classes, Logger classes, Configuration classes.
To remove duplicates from an ArrayList of strings, use a HashSet to store unique elements.
Create a HashSet and add all elements from the ArrayList to it.
Create a new ArrayList and add all elements from the HashSet to it.
The new ArrayList will contain only unique elements.
Using Java stream, find the sum of all odd numbers in a list.
Use the filter() method to filter out the odd numbers from the list.
Use the mapToInt() method to convert the filtered numbers to IntStream.
Use the sum() method to calculate the sum of the odd numbers.
Checked exceptions are exceptions that must be declared in a method's signature or handled using try-catch blocks.
Checked exceptions are checked at compile-time.
They are typically used for exceptional conditions that can be reasonably recovered from.
Examples of checked exceptions in Java include IOException, SQLException, and ClassNotFoundException.
HashSet and HashMap are data structures in Java that store elements using hashing techniques.
HashSet internally uses a HashMap to store its elements.
HashSet uses the elements as keys and stores them in the HashMap with a dummy value.
HashMap uses a hash function to convert the key into an index of an array where the value is stored.
HashMap uses separate chaining or open addressing to handle collisions.
Both HashSet ...
There are two types of locks in Java - synchronized and ReentrantLock. Multithreading can be achieved by using these locks.
Two types of locks in Java are synchronized and ReentrantLock
Synchronized keyword can be used to achieve synchronization in Java
ReentrantLock provides more flexibility and control over locking mechanisms
Example: synchronized block - synchronized(obj) { // code }
Example: ReentrantLock - Reentra...
I applied via Naukri.com and was interviewed in Nov 2024. There were 2 interview rounds.
I expect a competitive salary based on my skills, experience, and market standards for Java Developers.
Research industry standards: For example, the average salary for a Java Developer in my region is around $80,000 to $100,000.
Consider my experience: With over 5 years of experience, I believe a salary in the range of $90,000 to $110,000 is reasonable.
Evaluate the company's budget: I am open to discussing a salary that...
I applied via Naukri.com and was interviewed in Jul 2024. There was 1 interview round.
Dynamic arrays allow resizing and efficient storage of elements, adapting to varying data sizes.
Dynamic arrays can grow and shrink in size as needed, unlike static arrays.
In Java, the ArrayList class provides dynamic array functionality.
Example: ArrayList<String> dynamicArray = new ArrayList<>();
You can add elements using dynamicArray.add("example");
To access elements, use dynamicArray.get(index);
Dynamic ar...
Reversing a linked list involves changing the direction of the pointers between nodes.
Iterative Approach: Use three pointers (prev, current, next) to reverse links.
Example: For list 1 -> 2 -> 3, after reversal it becomes 3 -> 2 -> 1.
Recursive Approach: Reverse the rest of the list and adjust pointers.
Example: Base case when current is null, then set head to prev.
There are two types of locks in Java - synchronized and ReentrantLock. Multithreading can be achieved by using these locks.
Two types of locks in Java are synchronized and ReentrantLock
Synchronized keyword can be used to achieve synchronization in Java
ReentrantLock provides more flexibility and control over locking mechanisms
Example: synchronized block - synchronized(obj) { // code }
Example: ReentrantLock - ReentrantLoc...
Aptitude test for java developer
I applied via Naukri.com and was interviewed in Jan 2023. There were 2 interview rounds.
Top trending discussions
posted on 2 Jun 2022
I appeared for an interview before Jun 2021.
Had DSA and aptitude questions
posted on 16 Sep 2021
I appeared for an interview in Oct 2020.
Round duration - 75 min
Round difficulty - Medium
This round was MCQ and coding round. 25 MCQs and one coding question were asked. MCQs were based on OS, DBMS, Aptitude and Data Structures.
You have 'N' tasks to complete. Each task can only be done on one of two specific days provided in two arrays: day1
and day2
.
For each task i, day1[i]
represents the earliest...
Find the minimum number of days required to complete all tasks given specific completion days for each task.
Sort the tasks based on day1 in ascending order.
For each task, choose the minimum of day1 and day2 as the completion day.
Keep track of the maximum completion day for each task.
The final answer is the maximum completion day of all tasks.
Round duration - 30 min
Round difficulty - Easy
This was a Data Structural round. Only one coding question was asked by the interviewer. The interviewer was very friendly. This round was very easy.
Sort the given unsorted array consisting of N non-negative integers in non-decreasing order using the Bubble Sort algorithm.
The first line contains an integer 'T' r...
Bubble Sort algorithm is used to sort an array of non-negative integers in non-decreasing order.
Implement the Bubble Sort algorithm to sort the array in place.
Compare adjacent elements and swap them if they are in the wrong order.
Repeat this process until the array is sorted.
Time complexity of Bubble Sort is O(n^2) in the worst case.
Example: For input [6, 2, 8, 4, 10], the output should be [2, 4, 6, 8, 10].
Tip 1 : Be confident!
Tip 2 : Maintain high Cgpa
Tip 3 : Do your best
Tip 1 : Mention clear points
Tip 2 : Atleast 3 projects and never put anything you have not revised
posted on 16 Sep 2021
I appeared for an interview before Sep 2020.
Round duration - 75 minutes
Round difficulty - Medium
It was in the evening.
It consisted of 26 questions of easy to hard level.
It consisted of 25 MCQs and only 1 coding problem.
Given a structured list of books and their authors, format the information as specified.
The first line of input contains an integer ‘T' representing the number of tes...
The task is to format a list of authors and their books in a specific way as per the given input format.
Parse the input to extract the number of test cases, number of authors, author names, and their respective books.
Format the output by printing the author names and their books in the specified format.
Ensure correct sequence and labeling of authors and books as per the example provided.
Handle multiple test cases and a...
Round duration - 15 minutes
Round difficulty - Medium
It was more of CV based round. A brief discussion on projects was there followed by some questions like why optum.
You are provided with a linked list of integers. Your task is to implement a function that deletes a node located at a specified position 'POS'.
The first line co...
Implement a function to delete a node from a linked list at a specified position.
Traverse the linked list to find the node at the specified position.
Update the pointers of the previous and next nodes to skip the node to be deleted.
Handle edge cases such as deleting the head or tail of the linked list.
Ensure to free the memory of the deleted node to avoid memory leaks.
Round duration - 15 minutes
Round difficulty - Easy
A short round where some basic dbms questions like procedure, cursor were asked. Then some questions on whether I would prefer working alone or in a team. Where I see myself in 5 years.
You are given a graph with 'N' vertices numbered from '1' to 'N' and 'M' edges. Your task is to color this graph using two colors, such as blue and red, in a way that no two adjacen...
Given a graph with 'N' vertices and 'M' edges, determine if it can be colored using two colors without adjacent vertices sharing the same color.
Use graph coloring algorithm like BFS or DFS to check if the graph can be colored with two colors without conflicts.
Check if any adjacent vertices have the same color. If so, it is not possible to color the graph as described.
If the graph has connected components, color each co...
Tip 1 : Projects do not matter much for this company.
Tip 2 : I did almost all the puzzles from Interviewbit.
Tip 3 : DBMS is really important. Practice queries in SQL thoroughly. You should know the use of limit and top also. It may be asked to write the same query in more than 1 form.
Tip 4 : Practice all the data structures. Questions were simple and you should know the basics of every data structure.
Tip 1 : Don't write anything just for the sake of it.
Tip 2 : If you are writing some project then be thorough with all the details. If you are not much confident, then simply remove it and focus on other subjects.
posted on 12 Jun 2021
based on 6 interview experiences
Difficulty level
Duration
based on 13 reviews
Rating in categories
Technical Lead
2.9k
salaries
| ₹19.8 L/yr - ₹35 L/yr |
Senior Associate
2k
salaries
| ₹14.3 L/yr - ₹26 L/yr |
Senior Software Engineer
1.6k
salaries
| ₹10.6 L/yr - ₹28.4 L/yr |
Senior Associate Technology L1
1k
salaries
| ₹13.5 L/yr - ₹24.5 L/yr |
Associate Specialist
855
salaries
| ₹22 L/yr - ₹38 L/yr |
DXC Technology
Sutherland Global Services
Optum Global Solutions
Virtusa Consulting Services