i
Community
Brands
Filter interviews by
I use lambda expressions, streams, and default methods in my current project.
Lambda expressions: I use them to write more concise and functional code.
Streams: I use them for processing collections of data in a declarative way.
Default methods: I use them to provide default implementations in interfaces.
HashMap is an implementation of Map interface that stores key-value pairs using a hash table.
HashMap uses hashing to store and retrieve elements.
It uses an array of linked lists to handle collisions.
The hash code of the key is used to determine the index of the array.
If multiple keys have the same hash code, they are stored in the same linked list.
When retrieving a value, the hash code is used to find the correct ...
There are three types of iterators in Java: Iterator, ListIterator, and Enumeration.
Iterator is the most commonly used iterator, used to traverse collections like ArrayList, HashSet, etc.
ListIterator is used to traverse lists and allows bidirectional traversal and modification of elements.
Enumeration is the oldest type of iterator, used to traverse legacy collections like Vector and Hashtable.
The Java program counts the length of a string without using foreach and length function.
Iterate through each character of the string using a for loop
Increment a counter variable for each character encountered
Return the counter variable as the length of the string
OOP principles include encapsulation, inheritance, polymorphism, and abstraction, essential for modular and maintainable code.
Encapsulation: Bundling data and methods. Example: A class 'Car' with attributes like 'speed' and methods like 'accelerate()'.
Inheritance: Deriving new classes from existing ones. Example: 'ElectricCar' inherits from 'Car', adding features like 'batteryCapacity'.
Polymorphism: Methods behavi...
Explaining Java technical skills and analyzing code snippets for output prediction.
Understand Java syntax: Familiarity with variables, data types, and operators.
Control structures: Know how if-else, switch, and loops (for, while) work.
Object-oriented principles: Grasp concepts like inheritance, polymorphism, and encapsulation.
Exception handling: Be able to explain try-catch blocks and custom exceptions.
Collections...
ConcurrentModificationException occurs when a collection is modified while iterating. Fail-fast and fail-safe are strategies to handle this.
Fail-fast: Throws ConcurrentModificationException immediately when a collection is modified during iteration.
Example: Using an ArrayList in a for-each loop and modifying it leads to ConcurrentModificationException.
Fail-safe: Allows iteration over a collection even if it is mod...
I applied via LinkedIn and was interviewed in Apr 2023. There were 2 interview rounds.
Explaining Java technical skills and analyzing code snippets for output prediction.
Understand Java syntax: Familiarity with variables, data types, and operators.
Control structures: Know how if-else, switch, and loops (for, while) work.
Object-oriented principles: Grasp concepts like inheritance, polymorphism, and encapsulation.
Exception handling: Be able to explain try-catch blocks and custom exceptions.
Collections fram...
OOP principles include encapsulation, inheritance, polymorphism, and abstraction, essential for modular and maintainable code.
Encapsulation: Bundling data and methods. Example: A class 'Car' with attributes like 'speed' and methods like 'accelerate()'.
Inheritance: Deriving new classes from existing ones. Example: 'ElectricCar' inherits from 'Car', adding features like 'batteryCapacity'.
Polymorphism: Methods behaving di...
There are three types of iterators in Java: Iterator, ListIterator, and Enumeration.
Iterator is the most commonly used iterator, used to traverse collections like ArrayList, HashSet, etc.
ListIterator is used to traverse lists and allows bidirectional traversal and modification of elements.
Enumeration is the oldest type of iterator, used to traverse legacy collections like Vector and Hashtable.
HashMap is an implementation of Map interface that stores key-value pairs using a hash table.
HashMap uses hashing to store and retrieve elements.
It uses an array of linked lists to handle collisions.
The hash code of the key is used to determine the index of the array.
If multiple keys have the same hash code, they are stored in the same linked list.
When retrieving a value, the hash code is used to find the correct linke...
ConcurrentModificationException occurs when a collection is modified while iterating. Fail-fast and fail-safe are strategies to handle this.
Fail-fast: Throws ConcurrentModificationException immediately when a collection is modified during iteration.
Example: Using an ArrayList in a for-each loop and modifying it leads to ConcurrentModificationException.
Fail-safe: Allows iteration over a collection even if it is modified...
SQL query to find the 2nd highest salary of an employee.
Use the SELECT statement to retrieve the salaries in descending order.
Use the LIMIT clause to limit the result to the second row.
Use the OFFSET clause to skip the first row.
Combine the above steps in a single SQL query.
The Java program counts the length of a string without using foreach and length function.
Iterate through each character of the string using a for loop
Increment a counter variable for each character encountered
Return the counter variable as the length of the string
I use lambda expressions, streams, and default methods in my current project.
Lambda expressions: I use them to write more concise and functional code.
Streams: I use them for processing collections of data in a declarative way.
Default methods: I use them to provide default implementations in interfaces.
To avoid hash collisions, use a good hash function, increase the size of the hash table, and handle collisions using techniques like chaining or open addressing.
Use a good hash function that distributes the keys evenly across the hash table.
Increase the size of the hash table to reduce the chances of collisions.
Handle collisions using techniques like chaining (using linked lists) or open addressing (probing).
Chaining e...
Top trending discussions
To check if a directed graph is cyclic or not
Use Depth First Search (DFS) algorithm to traverse the graph
Maintain a visited set to keep track of visited nodes
Maintain a recursion stack to keep track of nodes in the current DFS traversal
If a node is visited and is already in the recursion stack, then the graph is cyclic
If DFS traversal completes without finding a cycle, then the graph is acyclic
Return a random byte from a stream of bytes with equal probability.
Create a variable to store the count of bytes read
Create a variable to store the current random byte
For each byte read, generate a random number between 0 and the count of bytes read
If the random number is 0, store the current byte as the random byte
Return the random byte
Check if a binary tree is a binary search tree or not.
Traverse the tree in-order and check if the values are in ascending order.
For each node, check if its value is greater than the maximum value of its left subtree and less than the minimum value of its right subtree.
Use recursion to check if all nodes in the tree satisfy the above condition.
Algorithm to find Nth-to-Last element in a singly linked list of unknown length
Traverse the list and maintain two pointers, one at the beginning and one at Nth node from beginning
Move both pointers simultaneously until the second pointer reaches the end of the list
The first pointer will be pointing to the Nth-to-Last element
If N=0, return the last element
Parse the list only once
Print all possible permutations of an array of integers
Use recursion to swap elements and generate permutations
Start with the first element and swap it with each subsequent element
Repeat the process for the remaining elements
Stop when all elements have been swapped with the first element
Print each permutation as it is generated
Design a stack that prints the minimum element pushed in O(1)
Use two stacks, one for storing elements and another for storing minimums
When pushing an element, compare it with the top of minimum stack and push the smaller one
When popping an element, pop from both stacks
To get the minimum element, just return the top of minimum stack
To find the starting point of a loop in a linked list, use Floyd's cycle-finding algorithm.
Use two pointers, one moving at twice the speed of the other.
When they meet, move one pointer to the head of the list and keep the other at the meeting point.
Move both pointers one step at a time until they meet again, which is the starting point of the loop.
To find a number in a matrix where all rows and columns are sorted non-decreasingly. Complexity of the solution.
Use binary search to find the number in each row and column
Start from the top-right corner or bottom-left corner to optimize search
Time complexity: O(m log n) or O(n log m) depending on the starting corner
I applied via LinkedIn and was interviewed in Nov 2024. There was 1 interview round.
I appeared for an interview in Apr 2021.
Round duration - 120 Minutes
Round difficulty - Medium
I was MCQ + Coding round, Their were MCQ Based on DSA, Aptitude and 2 easy coding questions.
Ninja is organizing a coding competition where two teams compete at a time. To keep it fair and interesting, both teams must have an equal number of members. Ninja’s ta...
Check if Ninja can create two teams with equal members given an integer N and its divisors.
Iterate through all divisors of N and assign members to the first or second team based on whether the divisor is even or odd.
Keep track of the total members in each team and check if they are equal at the end.
Return true if the total members in both teams are equal, false otherwise.
Bob has just turned 18 and opened a bank account. Being inexperienced with banking, Bob needs your help to validate whether an IFSC code provided by his bank is valid.
...Validate IFSC code based on given rules and return True or False for each test case.
Check if the code is 11 characters long.
Verify the first four characters are uppercase alphabets.
Ensure the fifth character is '0'.
Validate that the last six characters are alphanumeric.
Round duration - 50 Minutes
Round difficulty - Easy
The nature of the interviewer was very kind. The test was proctored, our webcam and mic were on, and shared my screen.
Round duration - 50 minutes
Round difficulty - Easy
The nature of the interviewer was very kind. The test was proctored, our webcam and mic were on, and shared my screen.
Tip 1 : Be strong at your basics.
Tip 2 : Do at least 2 projects and ask to find answers like why are you choosing this tech stack? why did not you choose its alternatives Know your project in and out because they might ask you for a modification in your project?
Tip 1 : Have some projects on your resume.
Tip 2 : Do not put false things on your resume.
Tip 3 : Try to keep a single-page resume.
It was combination of mcqs and 2 coding questions
Object-oriented programming concepts that focus on objects and classes for better code organization and reusability.
Encapsulation: Bundling data and methods that operate on the data into a single unit (class).
Inheritance: Ability of a class to inherit properties and behavior from another class.
Polymorphism: Ability to present the same interface for different data types.
Abstraction: Hiding the complex implementation det...
Java is a programming language while Putjon is not a recognized term in software development.
Java is a widely used programming language for developing applications.
Putjon is not a recognized term in software development, it may be a typo or a specific term not commonly used.
There is no direct comparison between Java and Putjon as they are not related.
Python interview question and coding
I appeared for an interview before Feb 2022.
I applied via Naukri.com and was interviewed before Jan 2024. There was 1 interview round.
posted on 30 Oct 2023
C# is a programming language developed by Microsoft for building a wide range of applications on the .NET framework.
C# is an object-oriented language with features like classes, inheritance, and polymorphism.
It is strongly typed, meaning variables must be declared with a specific data type.
C# supports modern programming concepts like async/await for asynchronous programming.
It is commonly used for developing desktop, w...
OOPs is a programming paradigm that uses objects to represent real-world entities and their interactions.
OOPs stands for Object-Oriented Programming.
It focuses on encapsulation, inheritance, and polymorphism.
Encapsulation means hiding the implementation details of an object from the outside world.
Inheritance allows creating new classes based on existing ones.
Polymorphism allows using a single interface to represent dif...
Some of the top questions asked at the Community Brands Java Software Developer interview -
based on 1 interview experience
Difficulty level
Duration
Software Engineer
58
salaries
| ₹13.6 L/yr - ₹23.5 L/yr |
QA Engineer
42
salaries
| ₹8.9 L/yr - ₹15 L/yr |
Senior Software Engineer
39
salaries
| ₹13 L/yr - ₹34 L/yr |
Software Developer
25
salaries
| ₹8.6 L/yr - ₹15.5 L/yr |
Technical Lead
22
salaries
| ₹21 L/yr - ₹35.5 L/yr |
Prime Focus Technologies
MapmyIndia
Yodlee
Bravura Solutions