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.
There were 4 sections with no negative marking but they had sectional cut-off.
Questions on C/C++, Operating Systems, Data Structures and aptitude were asked.
20 people were shortlisted after the first round. 2 coding questions out of 3 were to be solved in this round.
This problem can be solved using the hashing concept. The objective is to run over the string and record how many times each character appears in it in a hash map. Then we run over the string again, this time using the hash map as a reference to see if any of the characters are unique. If the character is unique, return the index.
Time Complexity: O(N)
The above approach requires two traversals of the string. To solve the question in a single traversal only, along with storing the count of a character store the index a particular character was encountered the first time. So when it comes to finding the first non-repeating character, just scan the hash map, instead of the string and return the character with occurrences as 1 and least index in the string.
1. For a rectangle, its top left and bottom right coordinates are given.
2. Coordinates of the rectangles are integer values.
3. Edges of the given rectangles will always be parallel to the X and Y coordinate axes of the cartesian plane.
4. It is guaranteed that both the rectangles will have at least a unit area.
As two given points are diagonals of a rectangle. so, x1 < x2, y1 < y2. similarly x3 < x4, y3 < y4.
so, bottom-left and top-right points of intersection rectangle can be found by using formula.
x5 = max(x1, x3);
y5 = max(y1, y3);
x6 = min(x2, x4);
y6 = min(y2, y4);
In case of no intersection, x5 and y5 will always exceed x6 and y5 respectively. The other two points of the rectangle can be found by using simple geometry.
Technical Interview round with questions on OOPS and OS.
What is Polymorphism in C++?
Polymorphism is defined as the ability to take more than one form. It is a feature that provides a function or an operator with more than one definition. It can be implemented using function overloading, operator overload, function overriding, virtual function.
What is malloc and calloc function?
The functions malloc() and calloc() are library functions that allocate memory dynamically. Dynamic means the memory is allocated during runtime (execution of the program) from the heap segment.
Initialization
malloc() allocates a memory block of given size (in bytes) and returns a pointer to the beginning of the block. malloc() doesn’t initialize the allocated memory. If you try to read from the allocated memory without first initializing it, then you will invoke undefined behavior, which will usually mean the values you read will be garbage.
calloc() allocates the memory and also initializes every byte in the allocated memory to 0. If you try to read the value of the allocated memory without initializing it, you’ll get 0 as it has already been initialized to 0 by calloc().
What is a virtual function?
A C++ virtual function is a member function in the base class that you redefine in a derived class. It is declared using the virtual keyword. It is used to tell the compiler to perform dynamic linkage or late binding on the function. A 'virtual' is a keyword preceding the normal declaration of a function. When the function is made virtual, C++ determines which function is to be invoked at the runtime based on the type of the object pointed by the base class pointer.
Difference between process and thread
. Process means any program is in execution. Thread means segment of a process.
2. Process takes more time to terminate. Thread takes less time to terminate.
3. Process takes more time for creation. Thread takes less time for creation.
4. Process also takes more time for context switching. Thread takes less time for context switching.
5. Process is less efficient in term of communication. Thread is more efficient in term of communication.
6. Multi programming holds the concepts of multi process. We don’t need multi programs in action for multiple threads because a single process consists of multiple threads.
7. Process is isolated. Threads share memory.
What is multithreading?
Multithreading is a process of executing multiple threads simultaneously. A thread is a lightweight sub-process, the smallest unit of processing. Multiprocessing and multithreading, both are used to achieve multitasking.
However, we use multithreading than multiprocessing because threads use a shared memory area. They don't allocate separate memory area so saves memory, and context-switching between the threads takes less time than process.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which array operation has O(n) worst-case time complexity?