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 was an online MCQ + coding round where we had 30 mins to solve the MCQ's and another 1 hour to solve 2 coding questions. The MCQ's were related to both General and Technical Aptitude and the coding questions were relatively easy if one has a decent grip on Data Structures and Algorithms.



For ‘N’ = 3,
All possible combinations are:
((()))
(()())
(())()
()(())
()()()
Approach :
generate function :
It will take a number of arguments :
‘TOTAL’ - an integer representing the total number of characters i.e twice the number of pairs.
‘OPEN’ - an integer representing the number of opening brackets till now.
‘CLOSE’ - an integer representing the number of closing brackets till now.
‘S’ - a string representing the parenthesis till now.
‘ANS’ - a vector of string to store all the generated parenthesis.
1) If the size of the string becomes equal to ‘TOTAL’’, that means that a valid parenthesis is generated, we will store it in the ‘ANS’ vector.
2) If ‘OPEN’ is greater than ‘CLOSE’,
2.1) Then we can give a closing bracket at this index.
2.2) Again if ‘OPEN’ is less than ‘TOTAL’ / 2, we can also give an opening bracket at this index.
3) Else we can only give an opening bracket at this index.
given function :
1) Declare a variable ‘TOTAL’ with a value twice as ‘N’, since each pair consists of two characters.
2) Declare a vector of strings ‘ANS’ to store all the valid parentheses.
3) Call the generate function with zero opening bracket, zero closing bracket, and an empty string.
4) Finally, return the ‘ANS’ vector.
TC : O(2 ^ N), where N is the total number of characters.
SC : O(1)



If a string has 'x' repeated 5 times, replace this "xxxxx" with "x5".
The string is compressed only when the repeated character count is more than 1.
Consecutive count of every character in the input string is less than or equal to 9. You are not required to print anything. It has already been taken care of. Just implement the given function and return the compressed string.
Approach :
1) Keep two indices, both starting from the initial character. Let’s say, ‘STARTINDEX’ and ‘ENDINDEX’. These indices are going to tell the start and end of the substring where the characters are the same.
2) Start moving the ‘ENDINDEX’ to every character till the character at ‘STARTINDEX’ is a match.
3) Whenever there is a mismatch, we can calculate the frequency of the character at the ‘STARTINDEX’ by subtracting the ‘STARTINDEX’ from ‘ENDINDEX’.
4) Append the character at the ‘STARTINDEX’ with its total frequency and add it to the final string you want to return. If the frequency of the character is 1, no need to append its frequency.
5) Move the ‘STARTINDEX' to ‘ENDINDEX’.
6) Repeat until all the characters are traversed in this manner.
TC : O(N), where N = length of the string
SC : O(1)
The interviewer asked me 1 coding problem in this round where I was expected to first explain my approach with proper complexity analysis and then code the solution. After that, some more questions related to DBMS and OOPS were also asked in this round.



Each pair should be sorted i.e the first value should be less than or equals to the second value.
Return the list of pairs sorted in non-decreasing order of their first value. In case if two pairs have the same first value, the pair with a smaller second value should come first.
Approach :
1) Initialize a list to store our results.
2) For each element in the array ‘ARR[i]’, we will check whether there exists an element equals to ('S' - ‘ARR[i]’) already in the map.
3) If it exists we will add the pair('ARR[i]', ‘S’ - ‘ARR[i]’ ) ‘COUNT’ number of times to the list, where ‘COUNT’ represents the frequency of ('S' - ‘ARR[i]’) in the map.
4) Also, we will increment the frequency of the current element ('ARR[i]') in the map. Sort the list of pairs as per the given output format and return this list.
TC : O(N^2), where N = size of the array
SC : O(N)
Explain the difference between the DELETE and TRUNCATE command in a DBMS.
DELETE command: This command is needed to delete rows from a table based on the condition provided by the WHERE clause.
1) It deletes only the rows which are specified by the WHERE clause.
2) It can be rolled back if required.
3) It maintains a log to lock the row of the table before deleting it and hence it’s slow.
TRUNCATE command: This command is needed to remove complete data from a table in a database. It is like a DELETE command which has no WHERE clause.
1) It removes complete data from a table in a database.
2) It can be rolled back even if required. (Truncate can be rolled back in some databases depending on their version but it can be tricky and can lead to data loss).
3) It doesn’t maintain a log and deletes the whole table at once and hence it’s fast.
Explain different languages present in DBMS.
Following are various languages present in DBMS :
1) DDL(Data Definition Language): It contains commands which are required to define the database.
E.g., CREATE, ALTER, DROP, TRUNCATE, RENAME, etc.
2) DML(Data Manipulation Language): It contains commands which are required to manipulate the data present in the database.
E.g., SELECT, UPDATE, INSERT, DELETE, etc.
3) DCL(Data Control Language): It contains commands which are required to deal with the user permissions and controls of the database system.
E.g., GRANT and REVOKE.
4) TCL(Transaction Control Language): It contains commands which are required to deal with the transaction of the database.
E.g., COMMIT, ROLLBACK, and SAVEPOINT.
What is Early Binding and Late Binding in C++ ?
OOP is used commonly for software development. One major pillar of OOP is polymorphism. Early Binding and Late Binding are related to that. Early Binding occurs at compile time while Late Binding occurs at runtime. In method overloading, the bonding happens using the early binding. In method overriding, the bonding happens using the late binding. The difference between Early and Late Binding is that Early Binding uses the class information to resolve method calling while Late Binding uses the object to resolve method calling.
Early Binding : In Early Binding, the class information is used to resolve method calling. Early Binding occurs at compile time. It is also known as the static binding. In this process, the binding occurs before the program actually runs. Overloading methods are bonded using early binding.
Late Binding : In Late Binding, the object is used to resolve method calling. Late Binding occurs at runtime. It is also known as dynamic binding. In this process, the binding occurs at program execution. Overridden methods are bonded using late binding.
In this round, the interviewer asked questions related to my projects. Since I did some web development projects , the interviewer grilled me on concepts related to HTML , CSS , React and JavaScript.
What is the difference between .call() and .apply()?
The function .call() and .apply() are very similar in their usage except a little difference. .call() is used when the number of the function’s arguments are known to the programmer, as they have to be mentioned as arguments in the call statement. On the other hand, .apply() is used when the number is not known. The function .apply() expects the argument to be an array.
How do you compare Object and Map?
Objects are similar to Maps in that both let you set keys to values, retrieve those values, delete keys, and detect whether something is stored at a key. Due to this reason, Objects have been used as Maps historically. But there are important differences that make using a Map preferable in certain cases.
1) The keys of an Object are Strings and Symbols, whereas they can be any value for a Map, including functions, objects, and any primitive.
2) The keys in Map are ordered while keys added to Object are not. Thus, when iterating over it, a Map object returns keys in order of insertion.
3) You can get the size of a Map easily with the size property, while the number of properties in an Object must be determined manually.
4) A Map is an iterable and can thus be directly iterated, whereas iterating over an Object requires obtaining its keys in some fashion and iterating over them.
5) An Object has a prototype, so there are default keys in the map that could collide with your keys if you're not careful. As of ES5 this can be bypassed by using map = Object.create(null), but this is seldom done.
6) A Map may perform better in scenarios involving frequent addition and removal of key pairs.
What is the difference between let and var
var :
1) It is been available from the beginning of JavaScript
2) It has function scope
3) Variables will be hoisted
let :
1) Introduced as part of ES6
2) It has block scope
3) Hoisted but not initialized
Let's take an example to see the difference,
function userDetails(username) {
if(username) {
console.log(salary); // undefined due to hoisting
console.log(age); // ReferenceError: Cannot access 'age' before initialization
let age = 35;
var salary = 19000;
}
console.log(salary); //10000 (accessible to due function scope)
console.log(age); //error: age is not defined(due to block scope)
}
userDetails('Ram');What are the various formatting tags in HTML?
HTML has various formatting tags :
- makes text bold
- makes text italic
- makes text italic but with added semantics importance
- increases the font size of the text by one unit
- decreases the font size of the text by one unit
- makes the text a subscript
- makes the text a superscript
- displays as strike out text
- marks the text as important
- highlights the text
- displays as added text
What are some of the advantages of HTML-5 over its previous versions?
Some advantages of HTML5 are :-
1) It has Multimedia Support.
2) It has the capabilities to store offline data using SQL databases and application cache.
3) Javascript can be run in the background.
4) HTML5 also allows users to draw various shapes like rectangles, circles, triangles, etc.
5) Included new Semantic tags and form control tags.
Difference between reset vs normalize CSS? How do they differ?
Reset CSS : CSS resets aim to remove all built-in browser styling. For example margins, paddings, font-sizes of all elements are reset to be the same.
Normalize CSS : Normalize CSS aims to make built-in browser styling consistent across browsers. It also corrects bugs for common browser dependencies.
What is a z-index, how does it function?
z-index is used for specifying the vertical stacking of the overlapping elements that occur at the time of its positioning. It specifies the vertical stack order of the elements positioned that helps to define how the display of elements should happen in cases of overlapping.
The default value of this property is 0 and can be either positive or negative. Apart from 0, the values of the z-index can be :
1) Auto: The stack order will be set equal to the parent.
2) Number: The number can be positive or negative. It defines the stack order.
3) Initial: The default value of 0 is set to the property.
4) Inherit: The properties are inherited from the parent.
The elements having a lesser value of z-index is stacked lower than the ones with a higher z-index.
What are the differences between a class component and functional component?
Class Components :
1) Class-based Components uses ES6 class syntax. It can make use of the lifecycle methods.
2) Class components extend from React.
3) In here you have to use this keyword to access the props and functions that you declare inside the class components.
Functional Components :
1) Functional Components are simpler comparing to class-based functions.
2) Functional Components mainly focuses on the UI of the application, not on the behavior.
3) To be more precise these are basically render function in the class component.
4) Functional Components can have state and mimic lifecycle events using React Hooks.
What is diffing algorithm?
React needs to use algorithms to find out how to efficiently update the UI to match the most recent tree. The diffing algorithm is generating the minimum number of operations to transform one tree into another. However, the algorithms have a complexity in the order of O(n^3) where n is the number of elements in the tree.
In this case, for displaying 1000 elements would require in the order of one billion comparisons. This is far too expensive. Instead, React implements a heuristic O(n) algorithm based on two assumptions :
1) Two elements of different types will produce different trees.
2) The developer can hint at which child elements may be stable across different renders with a key prop.
What are stateless and stateful components?
Stateless Components : If the behaviour is independent of its state then it can be a stateless component. You can use either a function or a class for creating stateless components. But unless you need to use a lifecycle hook in your components, you should go for function components.
Stateful Components : If the behaviour of a component is dependent on the state of the component then it can be termed a stateful component. These stateful components are always class components and have a state that gets initialized in the constructor.
What is reconciliation?
When a component's props or state change, React decides whether an actual DOM update is necessary by comparing the newly returned element with the previously rendered one. When they are not equal, React will update the DOM. This process is called reconciliation.

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