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.
This round had 3 coding questions of Medium to Hard level of difficulty.



Input arrays/lists can contain duplicate elements.
The intersection elements printed would be in the order they appear in the first array/list(ARR1)
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))
Approach 2 (Using Sorting and Binary Search) :
1) Sort the smaller array.
2) Iterate through the larger array and for every element search if it is present in the smaller array or not using Binary
Search.
3) If the element is present , then print it.
TC : min( O((M+N)*log(M)) , O((M+N)*log(N)) )
SC : O(1)



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 recurrence relation as follows:
ways[i][j] = ways[i-1][j] + ways[i][j-denominations[i]] (if j-denominations[i]>=0)
Where first term represents that we have excluded that coin and,
Second term represents that we have included that coin.
4) Base Case : Fill dp[0]=0 (as we can make 0 amount by giving no coins at all) and the remaining indices with
INT_MAX value
5) Finally , if dp[value]==INT_MAX , return -1 as it is not possible to make "value" using the given coins else return
dp[value] itself
TC : O(N*V) where N=number of coins and V=Value to be made
SC : O(N*V)



Suppose given input is "abacb", then the length of the longest substring without repeating characters will be 3 ("acb").
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 startfreq[s[start]] by 1 every time
7) Update ans by ans=max(ans , end-start+1)
8) Finally return ans
TC : O(N)
SC : O(26)=O(1)
This round started with 2 coding questions and then moved on to some more questions from OOPS.


The given linked list is 1 -> 2 -> 3 -> 2-> 1-> NULL.
It is a palindrome linked list because the given linked list has the same order of elements when traversed forwards and backward.
Can you solve the problem in O(N) time complexity and O(1) space complexity iteratively?
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 available for every call of recursion and the right pointer which passes in the function parameter of
recursion.
4) Now, if the left and right pointer node value is matched then return true from the current recursion call. Then the
recursion falls back to (n-2)th node, and then we need a reference to the 2nd node from head. So we advance the left
pointer in the previous call to refer to the next node in the Linked List.
5) If all the recursive calls are returning true, it means the given Linked List is a palindrome else it is not a palindrome.
TC : O(N), where N = number of nodes in the linked list.
SC : O(N)



Can you solve each query in O(logN) ?
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 pivoted array, pivot element is the only
element for which next element to it is smaller than it.
3) Using the above statement and binary search pivot can be found.
4) After the pivot is found out divide the array in two sub-arrays.
5) Now the individual sub – arrays are sorted so the element can be searched using Binary Search.
TC : O(Log(N))
SC : O(1)
What is Static variable in C ?
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;
Here,
datatype − The datatype of variable like int, char, float etc.
variable_name − This is the name of variable given by user.
value − Any value to initialize the variable. By default, it is zero.
What is the Difference Between Abstraction and Inheritance?
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.
“Java is not a pure OO language”. Justify this statement.
Java is not fully object oriented because it supports primitive data type like it,byte,long etc.,which are not objects. Because in JAVA we use data types like int, float, double etc which are not object oriented, and of course is what opposite of OOP is. That is why JAVA is not 100% objected oriented.
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.
What is event bubbling?
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 outer elements.
Syntax :
addEventListener(type, listener, useCapture)
type : Use to refer to the type of event.
listener : Function we want to call when the event of the specified type occurs.
userCapture : Boolean value. Boolean value indicates event phase. By Default useCapture is false. It means it is in the bubbling phase.
Difference between .on(‘click’) and .click()?
When we use ".click"
$("button.alert").click(function() {
alert(1);
});with the above, a separate handler gets created for every single element that matches the selector. That means
1) many matching elements would create many identical handlers and thus increase memory footprint
2) dynamically added items won't have the handler - ie, in the above html the newly added "Alert!" buttons won't work unless you rebind the handler.
When we use ".on"
$("div#container").on('click', 'button.alert', function() {
alert(1);
});with the above, a single handler for all elements that match your selector, including the ones created dynamically.
Using .click() will load an event handler per element into memory.
Using .on() with delegation is created only one for all elements.
How to optimize website assets loading?
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 and CSS files
5) Parallel downloads - Hosting assets in multiple subdomains can help to bypass the download limit of 6 assets per domain of all modern browsers. This can be configured but most general users never modify these settings.
6) Lazy Loading - Instead of loading all the assets at once, the non-critical assets can be loaded on a need basis.
In how many ways you can display HTML elements?
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 the container and element as a flexible structure. It follows flexbox property.
5) inline-flex: It displays the flex container as an inline element while its content follows the flexbox properties.
6) grid: It displays the HTML elements as a grid container.
7) none: Using this property we can hide the HTML element.
Write a SQL query to find all duplicate emails in a table named Person.
+----+---------+
| Id | Email |
+----+---------+
| 1 | a@b.com |
| 2 | c@d.com |
| 3 | a@b.com |
+----+---------+
For example, your query should return the following for the above table:
+---------+
| Email |
+---------+
| a@b.com |
+---------+Approach : Using GROUP BY and HAVING condition A more common used way to add a condition to a GROUP BY is to use the HAVING clause, which is much simpler and more efficient.
Query :
select Email
from Person
group by Email
having count(Email) > 1;Table: Person
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| PersonId | int |
| FirstName | varchar |
| LastName | varchar |
+-------------+---------+
PersonId is the primary key column for this table.
Table: Address
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| AddressId | int |
| PersonId | int |
| City | varchar |
| State | varchar |
+-------------+---------+
AddressId is the primary key column for this table.
Write a SQL query for a report that provides the following information for each person in the Person table, regardless if there is an address for each of those people:
FirstName, LastName, City, State
Approach : Since the PersonId in table Address is the foreign key of table Person, we can join this two table to get the address information of a person. Considering there might not be an address information for every person, we should use outer join instead of the default inner join.
Query :
select FirstName, LastName, City, State
from Person left join Address
on Person.PersonId = Address.PersonId ;


Anagrams are defined as words or names that can be formed by rearranging the letters of another word. Such as "spar" can be formed by rearranging letters of "rasp". Hence, "spar" and "rasp" are anagrams.
'triangle' and 'integral'
'listen' and 'silent'
Since it is a binary problem, there is no partial marking. Marks will only be awarded if you get all the test cases correct.
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. If both count arrays are same, then return true.
TC : O(N), where N = length of the string
SC : O(1)
This is a cultural fitment testing round. HR was very frank and asked standard questions. Then we discussed about my role.
Tell me something not there in your resume.
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 : Emphasize why you were inspired to apply for the job. You can also explain that you are willing to invest a great deal of energy if hired.
These are generally very open ended questions and are asked to test how quick wit a candidate is. So there is nothing to worry about if you have a good command over your communication skills and you are able to propagate your thoughts well to the interviewer.
Why should we hire you?
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 work environment etc.
Tip 4 : Since everybody in the interview panel is from tech background, here too you can expect some technical questions. No coding in most of the cases but some discussions over the design can surely happen.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?