Filter interviews by
I appeared for an interview in Apr 2024.
Invariants in Java are conditions that must always be true at a certain point in a program's execution.
Invariants help ensure the correctness of a program by defining conditions that should always hold true.
They are typically used in loops, data structures, and class invariants.
For example, in a stack data structure, an invariant could be that the stack is never empty when popping an element.
Customized collections in Java can be created by implementing the Collection interface or extending existing collection classes.
Implement the Collection interface and provide custom implementations for methods like add, remove, contains, etc.
Extend existing collection classes like ArrayList or LinkedList and override methods as needed.
Consider using generics to ensure type safety and reusability of the customized colle
Code to find anagram strings in an array of strings
Iterate through the array of strings
Sort each string alphabetically
Store sorted strings in a hashmap with original string as key
Return values of hashmap as list of anagram strings
Distributed transactions in core Java involve coordinating multiple transactional resources across different systems.
Distributed transactions involve multiple transactional resources across different systems.
Java provides support for distributed transactions through APIs like JTA (Java Transaction API) and JTS (Java Transaction Service).
Distributed transactions ensure ACID properties (Atomicity, Consistency, Isolation,...
Throttling in REST API is a technique used to limit the number of requests a client can make within a certain timeframe.
Throttling helps prevent server overload and ensures fair usage of resources.
Common methods of throttling include rate limiting, concurrency limiting, and request queuing.
For example, setting a rate limit of 100 requests per minute for a specific endpoint.
Throttling can be implemented at the API gatew
I applied via Naukri.com and was interviewed in Jun 2021. There was 1 interview round.
I applied via Referral and was interviewed before Jul 2021. There was 1 interview round.
posted on 28 Oct 2022
I applied via Recruitment Consulltant and was interviewed before Oct 2021. There were 3 interview rounds.
Not applicable , this was final round
I applied via Referral and was interviewed in Feb 2020. There were 6 interview rounds.
Queue can be implemented using two stacks by maintaining the order of elements in the stacks.
Create two stacks, let's call them stack1 and stack2
When an element is enqueued, push it to stack1
When an element is dequeued, pop all elements from stack1 and push them to stack2
Pop the top element from stack2 and return it as the dequeued element
If stack2 is empty, repeat step 3
To get the front element of the queue, peek the
Left join returns all records from left table and matching records from right table. Full outer join returns all records from both tables.
Left join is used to combine two tables based on a common column.
In left join, all records from the left table are returned along with matching records from the right table.
If there is no match in the right table, NULL values are returned.
Example: SELECT * FROM table1 LEFT JOIN table...
Magic functions are special methods in PHP that start with __. Autoloading is a way to automatically load classes.
Magic functions are used to handle certain events in PHP, such as object creation or property access.
Autoloading allows PHP to automatically load classes when they are needed, without requiring manual includes.
Magic functions can be used in conjunction with autoloading to dynamically load classes or handle
Given three sorted arrays, find common elements.
Create three pointers to traverse each array
Compare the elements at the pointers and move the pointer of the smallest element
If all pointers point to the same element, add it to the result and move all pointers
Repeat until any pointer reaches the end of its array
Check if a number is a power of 2 or not.
A power of 2 has only one bit set in its binary representation.
Use bitwise AND operator to check if the number is a power of 2.
If n is a power of 2, then n & (n-1) will be 0.
I applied via Referral
Event bubbling is the propagation of an event from the innermost child element to the outermost parent element.
Events triggered on a child element will also trigger on its parent elements
The event travels up the DOM tree until it reaches the document object
Can be stopped using event.stopPropagation()
Can be useful for event delegation
The .on('click',function() is a more flexible method than .click(function())
The .on() method can handle multiple events and selectors
The .click() method can only handle one event and one selector
The .on() method can also handle dynamically added elements
The .click() method cannot handle dynamically added elements
Function to check if two strings are anagram or not
Create two character arrays from the strings
Sort the arrays
Compare the sorted arrays
Function to determine the order of integers in an array.
Check first and last element to determine if increasing or decreasing
Check for inflection point to determine if order changes
Return order type as string
Optimize images, minify code, reduce HTTP requests, use caching, and lazy loading.
Optimize images using compression and appropriate file formats
Minify code to reduce file size and improve load times
Reduce HTTP requests by combining files and using sprites
Use caching to store frequently accessed data locally
Implement lazy loading to defer loading of non-critical resources
Design a database schema for a movie site with user ratings and recommendations.
Create tables for movies, users, ratings, and recommendations
Use foreign keys to link tables
Include columns for movie genre and user watch history
Algorithm for recommendations can use user watch history and ratings to suggest similar movies
Function to simulate dice roll with equal probability without using random function
Use a toss function that returns either 0 or 1 with equal probability
Call the toss function 3 times and convert the result to a binary number
If the binary number is greater than 0 and less than or equal to 6, return it
If the binary number is greater than 6, repeat the process
Query to fetch duplicate email from table
Use GROUP BY and HAVING clause to filter out duplicates
SELECT email, COUNT(*) FROM table_name GROUP BY email HAVING COUNT(*) > 1;
This will return all the duplicate emails in the table
based on 1 interview
Interview experience
based on 1 review
Rating in categories
Amazon Sellers Services
Primus Global Technologies
GAMMON INDIA
Practo