Find Interview Questions for Top Companies
Ques:- Lets say I have an existing application written using Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000 COM+ transaction services. How would you approach migrating this application to .NET
Right Answer:
To migrate the application from VB6 and COM+ to .NET, follow these steps:

1. **Assess the Application**: Analyze the existing application to understand its architecture, dependencies, and functionalities.

2. **Choose the Right .NET Framework**: Decide whether to use .NET Framework or .NET Core/5+ based on the application's requirements and future needs.

3. **Recreate Business Logic**: Rewrite the business logic in .NET, using C# or VB.NET, ensuring to maintain the same functionality.

4. **Migrate Data Access**: Replace COM+ data access methods with ADO.NET or Entity Framework for database interactions.

5. **Handle Transactions**: Implement .NET transaction management using System.Transactions to replace COM+ transaction services.

6. **UI Migration**: If the application has a user interface, consider using Windows Forms, WPF, or ASP.NET for web applications, depending on the original UI type.

7. **Testing**: Thoroughly test
Ques:- Test cases for vending machine
Asked In :-
Right Answer:
1. **Valid Coin Insertion**: Insert a valid coin and check if the machine accepts it and updates the balance correctly.

2. **Invalid Coin Insertion**: Insert an invalid coin and verify that the machine does not accept it and returns the coin.

3. **Product Selection**: Select a product after sufficient balance is available and ensure the product is dispensed correctly.

4. **Insufficient Balance**: Attempt to select a product without enough balance and check if the machine prompts for more coins.

5. **Exact Change**: Insert the exact amount for a product and confirm that the product is dispensed and the balance is zero.

6. **Change Dispensing**: Insert more than the required amount for a product and verify that the correct change is returned.

7. **Empty Product Slot**: Attempt to select a product that is out of stock and ensure the machine notifies the user.

8. **Cancel Transaction**: Request to cancel the transaction and check if the
Ques:- Given a fair coin, make an unfair coin that head with p probability and tail with (1-p) probability where 0 < p < 1.
Asked In :-
Right Answer:
To create an unfair coin that lands heads with probability ( p ) and tails with probability ( 1-p ), you can use the following method:

1. Flip the fair coin twice.
2. Define the outcomes as follows:
- If the first flip is heads (H) and the second flip is heads (H), return heads (H).
- If the first flip is heads (H) and the second flip is tails (T), return heads (H) with probability ( p ) and tails (T) with probability ( 1-p ).
- If the first flip is tails (T), return tails (T).

This way, you can achieve the desired probabilities for heads and tails.
Ques:- You have millions of lines of data. 2 lines are identical, the rest are unique. Some lines are so long, that they do not fit in memory. How would you find those 2 identical lines?
Asked In :-
Right Answer:
Use a hash function to create a hash for each line of data. Store these hashes in a set. As you process each line, check if its hash already exists in the set. If it does, you've found the duplicate line. If not, add the hash to the set. For lines that don't fit in memory, process them in chunks or use external sorting techniques to handle them efficiently.
Ques:- Write a code for minimal spanning tree
Asked In :-
Right Answer:
```python
class Graph:
def __init__(self, vertices):
self.V = vertices
self.graph = []

def add_edge(self, u, v, w):
self.graph.append((w, u, v))

def find(self, parent, i):
if parent[i] == i:
return i
return self.find(parent, parent[i])

def union(self, parent, rank, x, y):
xroot = self.find(parent, x)
yroot = self.find(parent, y)
if rank[xroot] < rank[yroot]:
parent[xroot] = yroot
elif rank[xroot] > rank[yroot]:
parent[yroot] = xroot
else:
parent[yroot] = xroot
rank[xroot] += 1

def kruskal(self):
result = []
self.graph.sort()
parent = []
rank = []
for node
Ques:- Given a NxN matrix with 0s and 1s. now whenever you encounter a 0 make the corresponding row and column elements 0.
Asked In :-
Right Answer:
To solve the problem, follow these steps:

1. Create two arrays, `rows` and `cols`, of size N initialized to `false`.
2. Traverse the matrix. Whenever you encounter a `0` at position `(i, j)`, set `rows[i]` and `cols[j]` to `true`.
3. After the first traversal, iterate through the matrix again. For each element at `(i, j)`, if `rows[i]` or `cols[j]` is `true`, set the element to `0`.

This approach ensures that you only modify the matrix after identifying all the rows and columns that need to be zeroed out.
Ques:- Lets say you have to construct google maps from scratch and guide a person standing on Gateway of India (Mumbai) to India Gate(Delhi).How do you do the same ?
Asked In :-
Right Answer:
To construct a navigation system from Gateway of India (Mumbai) to India Gate (Delhi), follow these steps:

1. **Data Collection**: Gather geographic data, including maps, road networks, and points of interest (POIs) using sources like OpenStreetMap or government datasets.

2. **Graph Representation**: Represent the map as a graph where intersections are nodes and roads are edges with weights based on distance or travel time.

3. **Routing Algorithm**: Implement a routing algorithm like Dijkstra's or A* to find the shortest path from the starting point (Gateway of India) to the destination (India Gate).

4. **User Input**: Allow users to input their starting location and destination.

5. **Pathfinding**: Use the routing algorithm to calculate the optimal route based on current traffic conditions, road closures, and other factors.

6. **Turn-by-Turn Directions**: Generate turn-by-turn directions based on the calculated route.

7. **User Interface**:
Ques:- What is difference between abstract class and an interface?What is shadowing?Difference between Overriding and overloading.
Right Answer:
**Difference between Abstract Class and Interface:**
- An abstract class can have method implementations, fields, and constructors, while an interface can only declare methods (until C# 8.0, where default implementations were introduced).
- A class can inherit from only one abstract class but can implement multiple interfaces.

**Shadowing:**
- Shadowing occurs when a derived class defines a member with the same name as a member in its base class, hiding the base class member.

**Difference between Overriding and Overloading:**
- Overriding is redefining a base class method in a derived class with the same signature, allowing for polymorphic behavior.
- Overloading is defining multiple methods with the same name but different parameters within the same class.
Ques:- You have 6 coins of Indian denomination (a+b+c+d+e+f=115 paisa) …if user ask for a change of 100,50,25,10,5 paisa then you r not able to give find the value of a,b,c,d,e,f………e.g. lets if user ask for a change of 25 paisa then you r n…
Asked In :-
Right Answer:
The values of the coins (a, b, c, d, e, f) can be: 50 paisa (a), 25 paisa (b), 25 paisa (c), 10 paisa (d), 5 paisa (e), and 5 paisa (f). This satisfies the equation a + b + c + d + e + f = 115 paisa.
Ques:- Given 2 trees A and B find if tree B is a subtree of Tree A or not. Provide the most optimized solution that you can think of.
Asked In :-
Right Answer:
To determine if tree B is a subtree of tree A, you can use the following optimized approach:

1. **Serialize both trees**: Convert both trees A and B into a string representation (e.g., using pre-order traversal with markers for null nodes).

2. **Search for B in A**: Check if the serialized string of tree B is a substring of the serialized string of tree A.

3. **Verify subtree structure**: If a match is found, perform a tree comparison starting from the matching node in A to ensure the structure and values of B match exactly.

This approach leverages serialization for efficient comparison and minimizes unnecessary tree traversal.
Ques:- We have three arrays A=[a1,a2,…an] B=[b1,b2,…bn] C=[c1,c2,…cn]
Asked In :-
Right Answer:
Please provide the specific question related to the arrays A, B, and C for me to give you the correct answer.
Ques:- 1.How to enter same record twice in target table? give me syntax.2. How to get particular record from the table in informatica?3.How to create primary key only on odd numbers?4. how to get the records starting with particular letter like A in informatica?
Right Answer:
1. To enter the same record twice in a target table, you can use the following SQL syntax:
```sql
INSERT INTO target_table (column1, column2, ...)
VALUES (value1, value2, ...),
(value1, value2, ...);
```

2. To get a particular record from the table in Informatica, you can use a Source Qualifier transformation with a SQL override:
```sql
SELECT * FROM source_table WHERE condition;
```

3. To create a primary key only on odd numbers, you would typically need to implement a custom logic in your application or database trigger, as SQL does not support conditional primary keys directly.

4. To get records starting with a particular letter like 'A' in Informatica, use a filter transformation with the condition:
```sql
column_name LIKE 'A%';
```
Ques:- Given a N x N matrix, find the median. the matrix is sorted row-wise and column-wise
Asked In :- Orion Innovation,
Right Answer:
To find the median in a sorted N x N matrix, you can use a binary search approach on the range of possible values. Here's a concise algorithm:

1. Set `low` to the minimum element (matrix[0][0]) and `high` to the maximum element (matrix[N-1][N-1]).
2. While `low` is less than or equal to `high`:
- Calculate `mid` as `(low + high) / 2`.
- Count how many numbers are less than or equal to `mid` in the matrix.
- If the count is less than or equal to `(N * N) / 2`, set `low` to `mid + 1`.
- Otherwise, set `high` to `mid - 1`.
3. The median will be `low` when the loop ends.

This algorithm efficiently finds the median in O(N log(max-min)) time, where `max` and `min`
Ques:- Write a function that accepts a string as parameter and check if the string is an integer. if the string is integer then return the integer value.
Asked In :-
Right Answer:
```python
def string_to_integer(s):
if s.isdigit() or (s[0] == '-' and s[1:].isdigit()):
return int(s)
return None
```
Ques:- A sequence of words are coming … a) you need to find if a particular word has already occurred in the series .. b) complexity should be proportional to the size of the word that is being scanned …
Asked In :-
Right Answer:
To check if a particular word has already occurred in a sequence of words, you can use a hash set. As you scan through the sequence, add each word to the set. For each word you want to check, simply see if it exists in the set. This approach has a time complexity of O(n) for scanning the sequence and O(1) for checking if the word exists, making the overall complexity proportional to the size of the word being scanned.
Ques:- Find the most frequent element in an array
Asked In :-
Right Answer:
To find the most frequent element in an array, you can use a hash map (or dictionary) to count the occurrences of each element. Then, iterate through the hash map to find the element with the highest count. Here’s a simple implementation in Python:

```python
def most_frequent_element(arr):
frequency = {}
for num in arr:
frequency[num] = frequency.get(num, 0) + 1
return max(frequency, key=frequency.get)

# Example usage:
arr = [1, 3, 2, 1, 4, 1, 3]
print(most_frequent_element(arr)) # Output: 1
```
Ques:- I have a file in which there are supposed to be 4 billion numbers, starting from 1 to 4,000,000,000 but unfortunately one number is missing, i.e there are only 3,999,999,999 numbers, I need to find the missing number.
Asked In :-
Right Answer:
You can find the missing number by calculating the expected sum of the first 4 billion numbers and subtracting the actual sum of the numbers in the file.

1. Calculate the expected sum:
[
text{Expected Sum} = frac{n(n + 1)}{2} = frac{4,000,000,000 times 4,000,000,001}{2}
]

2. Read the file and calculate the actual sum of the numbers.

3. The missing number is:
[
text{Missing Number} = text{Expected Sum} - text{Actual Sum}
]
Ques:- There is a list containing the checkin and checkout time of every person in a party . The checkin time is in ascending order while the checkout is random .
Asked In :-
Right Answer:
To find the maximum number of people present at the party at any given time, you can use a two-pointer technique or a sweep line algorithm.

1. Create two lists: one for check-in times and one for check-out times.
2. Sort the check-out times.
3. Initialize two pointers: one for the check-in list and one for the check-out list.
4. Traverse both lists:
- Increment the count when a person checks in.
- Decrement the count when a person checks out.
5. Keep track of the maximum count during the traversal.

The maximum count will be the answer.
Ques:- Write code to find Inorder Predecessor in BST (you don't have parent pointer)
Asked In :-
Right Answer:
```python
class TreeNode:
def __init__(self, key):
self.left = None
self.right = None
self.val = key

def inorder_predecessor(root, key):
predecessor = None
current = root

while current:
if key < current.val:
current = current.left
elif key > current.val:
predecessor = current
current = current.right
else:
if current.left:
predecessor = current.left
while predecessor.right:
predecessor = predecessor.right
break

return predecessor
```
Ques:- How to reduce the no of calls.. to malloc()…. to allocate a 2-d array.
Asked In :-
Right Answer:
To reduce the number of calls to `malloc()` when allocating a 2-D array, allocate a single contiguous block of memory for the entire array and then use pointer arithmetic to access the elements. For example:

```c
int rows = 5, cols = 10;
int *array = (int *)malloc(rows * cols * sizeof(int));
```

You can access the element at row `i` and column `j` using `array[i * cols + j]`. This way, you only call `malloc()` once.


The Tech Architect section on takluu.com is dedicated to professionals aiming to lead the design and implementation of complex software systems. A Tech Architect plays a pivotal role in bridging business needs with technology solutions, ensuring that applications are scalable, maintainable, and aligned with organizational goals.

This category covers critical areas including system design principles, software architecture patterns (like microservices, SOA, MVC), cloud architecture, security best practices, API design, and performance optimization. You will also explore architecture documentation, stakeholder communication, and technology evaluation techniques.

Our content provides deep insights into both theoretical concepts and practical challenges faced by tech architects in real projects. Interview questions focus on problem-solving skills, architectural trade-offs, decision-making under constraints, and aligning technology stacks with business requirements.

Whether you’re preparing for roles like Technical Architect, Solution Architect, Enterprise Architect, or Lead Developer, this section equips you with the knowledge to explain complex designs clearly, defend your architectural choices, and demonstrate leadership in technology planning.

At Takluu, we combine detailed explanations with scenario-based questions and case studies to ensure you are ready for both technical and behavioral rounds in tech architect interviews. Our goal is to empower you to design robust solutions and take ownership of technology roadmaps confidently.

Prepare with us and take the next step in your career to become a successful Tech Architect who drives innovation and delivers impactful technology strategies.

AmbitionBox Logo

What makes Takluu valuable for interview preparation?

1 Lakh+
Companies
6 Lakh+
Interview Questions
50K+
Job Profiles
20K+
Users