i
UKG
Filter interviews by
1 coding question, 19 mcqs on dsa, c++, java, cs fundamnetals
Top trending discussions
Deep copy creates a new object with its own copies of the original's data, while shallow copy shares references to the original's data.
Shallow Copy: Copies the reference of an object, not the actual object. Example: `List<int> shallow = original;`
Deep Copy: Creates a new object and recursively copies all objects found in the original. Example: `List<int> deep = new List<int>(original);`
Need for Copy C...
To merge two double linked lists, traverse to the end of the first list and connect it to the head of the second list.
Traverse to the end of the first list
Connect the last node of the first list to the head of the second list
If the lists are singly linked, we need to traverse to the end of the first list and connect it to the head of the second list. But we also need to keep track of the last node of the first list to ...
A dynamic data structure for storing images as arrays of strings.
Use a 2D array of strings to represent the image pixels.
Implement resizing methods to adjust the size of the image.
Include methods for adding, removing, and modifying pixels.
Consider using compression techniques to reduce memory usage.
Support various image formats such as JPEG, PNG, and BMP.
Copying fixed number of bytes from source to destination and its test cases.
Ensure source and destination are not overlapping
Check if the number of bytes to be copied is greater than the available space in the destination
Handle cases where source or destination is NULL
Test cases should cover all possible scenarios including edge cases
An optimized Fibonacci program computes Fibonacci numbers efficiently.
Use memoization to store previously computed values.
Use iterative approach instead of recursive approach.
Use bitwise operators to perform arithmetic operations faster.
Use matrix exponentiation to compute Fibonacci numbers in logarithmic time.
Virtual functions can cause problems due to their dynamic nature, but can be solved using various techniques.
Use pure virtual functions to ensure all derived classes implement the function
Use interface classes to define a common interface for all derived classes
Use smart pointers to manage memory and avoid memory leaks
Use virtual destructors to ensure proper destruction of objects
Avoid excessive use of virtual function...
DSA,COMPUTER FUNDAMENTALS
Tree traversals are methods used to visit each node in a tree data structure in a specific order.
Inorder traversal: Visit left subtree, then root, then right subtree
Preorder traversal: Visit root, then left subtree, then right subtree
Postorder traversal: Visit left subtree, then right subtree, then root
It consisted of both technical programming and theoretical concepts. C++ and SQL
Sorting algorithms differ in their approach to sorting elements in an array.
Bubble Sort - compares adjacent elements and swaps them if they are in the wrong order
Merge Sort - divides the array into two halves, sorts them, and then merges them
Quick Sort - picks a pivot element and partitions the array around the pivot
Selection Sort - repeatedly selects the minimum element and swaps it with the current element
Insertion S...
Basic dp and graph questions
Calculate the sum of all left leaf nodes in a binary tree.
Traverse the binary tree using depth-first search (DFS)
Check if a node is a leaf node and if it is a left child
Add the value of the left leaf node to the sum
Recursively traverse the left and right subtrees
I applied via Campus Placement and was interviewed before Oct 2022. There were 4 interview rounds.
Aptitude and technical questions
2 coding questions with choice of language
I applied via Referral and was interviewed in Feb 2024. There were 2 interview rounds.
Climb stairs problem involves finding the number of ways to reach the top of a staircase with 1 or 2 steps at a time.
Dynamic Programming approach can be used to solve this problem efficiently.
Base cases: If there are 0 stairs, there's 1 way (do nothing). If 1 stair, there's also 1 way (1 step).
For n stairs, the number of ways to reach the top is the sum of ways to reach (n-1) and (n-2) stairs.
Example: For 3 stairs, way...
Reversing a linked list involves changing the direction of the pointers between nodes.
Iterative approach: Use three pointers (prev, current, next) to reverse links.
Example: For list 1 -> 2 -> 3, after reversal it becomes 3 -> 2 -> 1.
Recursive approach: Reverse the rest of the list and adjust pointers.
Example: Base case is when the list is empty or has one node.
Rotten oranges problem involves finding the time to rot all oranges in a grid.
Use BFS to spread the rot from initially rotten oranges.
Track the number of minutes taken to rot all oranges.
If any fresh oranges remain after BFS, return -1.
Example: In a 3x3 grid, rotten oranges at (0,0) can rot (0,1) in 1 minute.
I applied via LinkedIn and was interviewed in Nov 2022. There were 3 interview rounds.
General questions like reasoning and maths
General DSA questions were asked like Linked list etc
I applied via Approached by Company and was interviewed before Jun 2021. There were 2 interview rounds.
Frameworks provide structure and pre-built components for software development, but can also limit flexibility and require learning curve.
Advantage: Provides structure and pre-built components for faster development
Advantage: Can improve code quality and maintainability
Disadvantage: Can limit flexibility and customization
Disadvantage: Requires learning curve and potential dependency issues
Example: ReactJS provides a fr...
Oops stands for Object-Oriented Programming. It is a programming paradigm that uses objects to represent real-world entities.
Advantages: code reusability, modularity, encapsulation, inheritance, polymorphism
Disadvantages: complexity, steep learning curve, performance overhead
Example: creating a class 'Car' with properties like 'make', 'model', and 'year', and methods like 'start_engine' and 'stop_engine'
based on 1 interview experience
Senior Software Engineer
661
salaries
| ₹10 L/yr - ₹25 L/yr |
Lead Software Engineer
432
salaries
| ₹14.5 L/yr - ₹34 L/yr |
Principal Software Engineer
259
salaries
| ₹19.3 L/yr - ₹44.8 L/yr |
Software Engineer
123
salaries
| ₹12.4 L/yr - ₹22.2 L/yr |
Senior Software QA Engineer
100
salaries
| ₹8 L/yr - ₹17.5 L/yr |
Oracle
Amdocs
Automatic Data Processing (ADP)
24/7 Customer