Filter interviews by
Be the first one to contribute and help others!
I applied via Company Website and was interviewed in Aug 2020. There was 1 interview round.
I appeared for an interview in Feb 2025, where I was asked the following questions.
ArrayList uses dynamic arrays, while LinkedList uses doubly linked nodes for storage and access.
ArrayList provides fast random access (O(1)) due to its underlying array structure.
LinkedList allows for efficient insertions and deletions (O(1)) at both ends and in the middle.
ArrayList has a fixed size, requiring resizing (O(n)) when capacity is exceeded, while LinkedList grows dynamically.
Example: Use ArrayList for frequ...
Java's synchronized keyword offers thread safety but has limitations compared to ReentrantLock.
Advantages of synchronized: Simple to use and understand.
Disadvantages of synchronized: Can lead to thread contention and performance issues.
ReentrantLock allows more flexibility, such as tryLock() and timed lock attempts.
ReentrantLock can be used for fair locking, preventing thread starvation.
Synchronized blocks are tied to ...
In Java, '==' checks reference equality, while '.equals()' checks value equality. Use them appropriately to avoid bugs.
== compares object references, checking if both point to the same memory location.
Example: String a = new String('test'); String b = new String('test'); a == b returns false.
.equals() compares the actual content of the objects.
Example: a.equals(b) returns true because the content is the same.
Use '==' f...
Java 8 introduced lambdas, Stream API, and other features that enhance functional programming and simplify code.
Lambdas: Enable concise representation of functional interfaces. Example: (x, y) -> x + y.
Stream API: Facilitates functional-style operations on collections. Example: list.stream().filter(x -> x > 10).collect(Collectors.toList()).
Default Methods: Allow adding new methods to interfaces without breakin...
Checked exceptions must be declared or handled, while unchecked exceptions do not require explicit handling.
Checked exceptions are subclasses of Exception but not of RuntimeException.
Example: IOException, SQLException are checked exceptions.
Unchecked exceptions are subclasses of RuntimeException.
Example: NullPointerException, ArrayIndexOutOfBoundsException are unchecked exceptions.
Checked exceptions must be caught or d...
The Java Memory Model defines how threads interact through memory, ensuring visibility and ordering of shared variables.
The Java Memory Model (JMM) specifies how threads interact with memory, ensuring consistency and visibility.
It defines rules for visibility, atomicity, and ordering of operations in a multithreaded environment.
Synchronization mechanisms (like synchronized blocks) ensure that only one thread can access...
Method overloading allows multiple methods with the same name but different parameters; overriding redefines a method in a subclass.
Method Overloading: Same method name, different parameters (type, number, or both).
Example of Overloading: 'void add(int a, int b)' and 'void add(double a, double b)'.
Use Overloading for convenience and readability when methods perform similar functions.
Method Overriding: Redefining a meth...
I appeared for an interview before Sep 2020.
Round duration - 90 Minutes
Round difficulty - Medium
This is a written round on paper for everyone. Three coding questions were given. Two out of three must be correct covering every single edge case to qualify for the next round. Only the most optimal solution was to be considered.
Given an array ARR
consisting of N
integers, your goal is to determine the maximum possible sum of a non-empty contiguous subarray within this array.
Find the maximum sum of a contiguous subarray in an array of integers.
Use Kadane's algorithm to find the maximum subarray sum in linear time.
Initialize two variables: maxSum and currentSum.
Iterate through the array and update currentSum by adding the current element or starting a new subarray.
Update maxSum if currentSum becomes greater than maxSum.
Return maxSum as the maximum subarray sum.
Round duration - 50 Minutes
Round difficulty - Easy
This was face to face interview round.
You are given a Binary Tree of integers and an integer 'X'. Your task is to find all the triplets in the tree whose sum is strictly greater than 'X'. Th...
Find all triplets in a binary tree whose sum is greater than a given integer X, with a grandparent-parent-child relationship.
Traverse the binary tree to find all possible triplets.
Check if the sum of each triplet is greater than X.
Ensure the relationship of grandparent-parent-child in each triplet.
Return the valid triplets in any order.
Handle constraints and edge cases appropriately.
Round duration - 60 Minutes
Round difficulty - Easy
FACE TO FACE ROUND INTERVIEW
Mutex is used for exclusive access to a resource by only one thread at a time, while Semaphores can allow multiple threads to access a resource simultaneously.
Mutex is binary and allows only one thread to access a resource at a time, while Semaphores can have a count greater than one.
Mutex is used for protecting critical sections of code, while Semaphores can be used for controlling access to a pool of resources.
Exampl...
Tip 1 : Participate in previous interview questions from leetcode, geeksforgeeks
Tip 2 : Revise computer science subjects like dbms and oops thoroughly
Tip 3 : Participate in live contests on CodeChef, Codeforces
Tip 1 : Only write the things on which you are the most confident about
Final outcome of the interviewRejectedI appeared for an interview before Sep 2020.
Round duration - 60 minutes
Round difficulty - Easy
There was 2 coding questions
Based on ds and algorithms
Your task is to determine the minimum number of platforms required at a railway station so that no train has to wait.
Given two arrays:
AT
- represent...Determine the minimum number of platforms needed at a railway station so that no train has to wait.
Sort the arrival and departure times arrays in ascending order.
Initialize two pointers, one for arrival times and one for departure times.
Increment the platform count when a train arrives and decrement when it departs.
Keep track of the maximum platform count needed.
Return the maximum platform count as the minimum number o
Given a string S
of length N
, an array A
of length M
consisting of lowercase letters, and a positive integer K
, determine the minimum number of swaps r...
The minimum number of swaps required to make a string K-periodic by replacing characters with elements from an array.
Iterate through the string and check if each character matches the character K positions ahead.
Count the number of characters that need to be swapped to make the string K-periodic.
Use the array elements to swap characters in the string.
Return the total number of swaps needed for each test case.
Round duration - 45 minutes
Round difficulty - Medium
It was good round they asked me about all the ds and algo basics
With 2 problems by sharing the screeen
You are provided with a 2-dimensional matrix having N
rows and M
columns, containing only 1s (land) and 0s (water). Your goal is to determine the number of islands in t...
Count the number of islands in a 2D matrix of 1s and 0s.
Use Depth First Search (DFS) or Breadth First Search (BFS) to traverse the matrix and identify connected groups of 1s.
Maintain a visited array to keep track of visited cells to avoid redundant traversal.
Increment the island count each time a new island is encountered.
Consider all eight possible directions for connectivity while traversing the matrix.
Handle edge ca...
Given an array of integers with 'N' elements, determine the length of the longest subsequence where each element is greater than the previous element. This...
Find the length of the longest strictly increasing subsequence in an array of integers.
Use dynamic programming to solve this problem efficiently.
Initialize an array to store the length of the longest increasing subsequence ending at each index.
Iterate through the array and update the length of the longest increasing subsequence for each element.
Return the maximum value in the array as the result.
Round duration - 50 minutes
Round difficulty - Medium
In this round, three questions were asked and all of them were based on DSA and a little bit about projects.
Bob and his wife are in the famous 'Arcade' mall in the city of Berland. This mall has a unique way of moving between shops using trampolines. Each shop is laid out in a st...
Find the minimum number of jumps Bob needs to make from shop 0 to reach the final shop, or return -1 if impossible.
Use BFS to traverse through the shops and keep track of the minimum jumps required.
If at any point the current shop is unreachable (Arr[i] = 0), return -1.
Optimize by using a visited array to avoid revisiting the same shop.
Tip 1 : Be enough confident, don't be nervous. Maintain atleast 2 projects in your resume.
Tip 2 : You should be able to answer each and every thing present in your resume. Don't lie in your resume.
Tip 3 : Prepare Data Structures and Algorithms well. They mostly check our Problem Solving ability to find the solutions for the real world problems
Tip 1 : Build your resume such that it grabs the eye of the interviewer
Tip 2 : metion your key skills and also maintain atleast 2 projects
I applied via Naukri.com and was interviewed before Nov 2020. There were 5 interview rounds.
I applied via Referral and was interviewed before Jan 2021. There were 4 interview rounds.
An interview is a formal conversation between an employer and a job candidate to assess their suitability for a role.
Interviews are used to evaluate a candidate's skills, experience, and personality.
They can be conducted in person, over the phone, or via video conferencing.
Interviews typically involve a series of questions and may include assessments or tests.
Examples of common interview questions include 'Tell me abou
I plan to save a portion, invest in professional development, and treat myself to a small reward.
Save a portion of the salary for future financial goals
Invest in professional development such as courses or certifications
Treat myself to a small reward or experience as a form of celebration
I appeared for an interview in Dec 2020.
Round duration - 25 Minutes
Round difficulty - Medium
Very friendly interviewer. Although waiting time was very high
You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.
Find pairs of elements in an array that sum up to a given value, sorted in a specific order.
Iterate through the array and for each element, check if the complement (S - current element) exists in a hash set.
If the complement exists, add the pair to the result list.
Sort the result list based on the criteria mentioned in the question.
Return the sorted list of pairs.
Tip 1 : be confident about your CV points
Tip 2 : practice consulting cases and how to answer situational questions
Tip 1 : be crisp about achievement
Tip 2 : add data points to support your achievements
I applied via Company Website and was interviewed in Oct 2020. There was 1 interview round.
Engineer
4
salaries
| ₹3.8 L/yr - ₹15 L/yr |
Senior Engineer
3
salaries
| ₹4 L/yr - ₹7 L/yr |
Amazon
Larsen & Toubro Limited
Mahindra & Mahindra
Siemens