Filter interviews by
Data Structures and Algorithms
Design a URL shortener system
Generate a unique short code for each long URL
Store the mapping between short code and long URL in a database
Redirect users from short URL to original long URL
Top trending discussions
I applied via LinkedIn and was interviewed in May 2024. There was 1 interview round.
Permutations and combinations, time and work
Baesd on leetcode question varies from easy to difficult
I applied via LinkedIn and was interviewed in Jul 2024. There was 1 interview round.
Coding test based on Binary trees, String Manipulation
I applied via Shine and was interviewed in Jan 2024. There was 1 interview round.
I applied via Walk-in and was interviewed in Aug 2021. There was 1 interview round.
I was interviewed in Aug 2021.
Round duration - 90 minutes
Round difficulty - Medium
This round had 3 coding questions of Medium to Hard level of difficulty.
Given two integer arrays ARR1
and ARR2
of sizes 'N' and 'M' respectively, find the intersection of these arrays. The intersection is defined as the se...
Approach 1 (Using Hashing) :
1) Initialize an empty set hs.
2) Iterate through the first array and put every element of the first array in the set S.
3) For every element x of the second array, do the following :
Search x in the set hs. If x is present, then print it.
TC : O(N+M) under the assumption that hash table search and insert operations take O(1) time, here N=size of array
1 and M=size of array 2.
SC : O(min(N,M))
Appr...
Given an infinite supply of coins of varying denominations, determine the total number of ways to make change for a specified value using these coins. If it's not possible to make...
This was a very standard DP problem and I had already solved it on platforms like LeetCode and CodeStudio so I
was able to come up with the logic and code it preety fast.
Steps :
1) Create a two-dimensional array, ‘dp’, where ‘dp[i][j]’ will denote the total number of ways to make j value by using i
coins.
2) Run 2 loops ,1st one from 1 to value and second one throught the array denominations.
3) Fill dp array by the recurre...
Given a string S
of length L
, determine the length of the longest substring that contains no repeating characters.
"abac...
Approach : I solved it using 2-pointers and keeping a track of the frequency of the elements encountered in a freq
array of size 26.
Steps :
1) Initiliase a freq array of size 26 where a=0, b=1 ...,z=25 .
2) Let s be our string and n = s.size()
3) Do , freq[s[0]]++;
4) Keep 2 pointers start and end where initially start=0 and end=1 also maintain a answer variable ans where initially
ans=0
5) Now run a loop till end=1 and start...
Round duration - 60 minutes
Round difficulty - Medium
This round started with 2 coding questions and then moved on to some more questions from OOPS.
You are provided with a singly linked list of integers. Your task is to determine whether the given singly linked list is a palindrome. Return true
if it is a pali...
Approach :
1) Recursively traverse the entire linked list to get the last node as a rightmost node.
2) When we return from the last recursion stack. We will be at the last node of the Linked List. Then the last node
value is compared with the first node value of Linked List.
3) In order to access the first node of Linked List, we create a global left pointer that points to the head of Linked List
initially that will be avai...
Given a sorted array that has been rotated, the task is to find the index of a specific element. The array is initially sorted in ascending order and then rotated ...
This was a preety standard Binary Search Question and I had solved this question before on platforms like LeetCode
and CodeStudio . I was asked this question to test my implementation skills and how well do I handle Edge Cases .
Approach :
1) The idea is to find the pivot point, divide the array in two sub-arrays and perform binary search.
2) The main idea for finding pivot is – for a sorted (in increasing order) and pivot...
1) Static variables are initialized only once.
2) The compiler persists with the variable till the end of the program.
3) Static variables can be defined inside or outside the function.
4) They are local to the block.
5) The default value of static variables is zero.
6) The static variables are alive till the execution of the program.
Here is the syntax of static variables in C language,
static datatype variable_name = value;
...
The main difference between abstraction and inheritance is that abstraction allows hiding the internal details and displaying only the functionality to the users, while inheritance allows using properties and methods of an already existing class.
Round duration - 60 minutes
Round difficulty - Medium
This round had questions mainly from HTML,CSS and JavaScript as I had mentioned some Frontend Projects in my resume so the interviewer wanted to check my skills on those. He also asked me some SQL queries and a simple coding question towards the end of the interview.
Event bubbling is a method of event propagation in the HTML DOM API when an event is in an element inside another element, and both elements have registered a handle to that event. It is a process that starts with the element that triggered the event and then bubbles up to the containing elements in the hierarchy. In event bubbling, the event is first captured and handled by the innermost element and then propagated to...
To optimize website load time we need to optimize its asset loading and for that:
1) CDN hosting - A CDN or content delivery network is geographically distributed servers to help reduce latency.
2) File compression - This is a method that helps to reduce the size of an asset to reduce the data transfer
3) File concatenation - This reduces the number of HTTP calls
4) Minify scripts - This reduces the overall file size of js...
1) inline: Using this we can display any block-level element as an inline element. The height and width attribute values of the element will not affect.
2) block: using this, we can display any inline element as a block-level element.
3) inline-block: This property is similar to inline, except by using the display as inline-block, we can actually format the element using height and width values.
4) flex: It displays...
Anagrams are words or names that can be formed by rearranging the letters of another word. For instance, 'spar' can be rearranged to form 'rasp', making them anagrams.
Approach 1(Using Sorting) :
1) Sort both strings
2) Compare the sorted strings
TC : O(N*log(N)), where N = length of the string
SC : O(1)
Approach 2(Counting characters) :
1) Create count arrays of size 256 for both strings. Initialize all values in count arrays as 0.
2) Iterate through every character of both strings and increment the count of character in the corresponding count arrays.
3) Compare count arrays. I...
Round duration - 30 minutes
Round difficulty - Easy
This is a cultural fitment testing round. HR was very frank and asked standard questions. Then we discussed about my role.
If you get this question, it's an opportunity to choose the most compelling information to share that is not obvious from your resume.
Example :
Strength -> I believe that my greatest strength is the ability to solve problems quickly and efficiently, which makes me unique from others.
Ability to handle Pressure -> I enjoy working under pressure because I believe it helps me grow and become more efficient.
Tip : Empha...
Tip 1 : The cross questioning can go intense some time, think before you speak.
Tip 2 : Be open minded and answer whatever you are thinking, in these rounds I feel it is important to have opinion.
Tip 3 : Context of questions can be switched, pay attention to the details. It is okay to ask questions in these round, like what are the projects currently the company is investing, which team you are mentoring. How all is the...
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
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
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.
based on 2 interviews
Interview experience
based on 2 reviews
Rating in categories
Senior Software Engineer
46
salaries
| ₹16 L/yr - ₹70 L/yr |
Software Engineer2
25
salaries
| ₹32 L/yr - ₹65 L/yr |
Software Engineer
20
salaries
| ₹25 L/yr - ₹58 L/yr |
Engineering Manager
13
salaries
| ₹70 L/yr - ₹120.1 L/yr |
Software Engineer III
10
salaries
| ₹30 L/yr - ₹72 L/yr |
Amazon
Etsy
Pepperfry
Urban Ladder