NortonLifeLock's
20+ Interview Questions and Answers
Q1. How to implement fopen, fseek and other file handling functions in Linux, went to discuss various techniques and various constraints like handling a large file.(Almost discussed it for 50 mins)
The fopen, fseek, and other file handling functions in Linux are implemented using various techniques and constraints.
fopen function is used to open a file and returns a file pointer
fseek function is used to set the file position indicator
Other file handling functions like fread, fwrite, fclose, etc. are used for reading, writing, and closing files
To handle large files, techniques like memory mapping, buffered I/O, and asynchronous I/O can be used
Memory mapping allows accessi...read more
Q2. calX(n) = calX(n-1)*calX(n-2)+calX(n-3), for n > 3 calX(n) = n, for n<=3 Upto what value of n we can find the correct value of calX(n) in C++
Q3. how you find loop in a linked list
To find a loop in a linked list, we use Floyd's cycle-finding algorithm.
Floyd's cycle-finding algorithm uses two pointers, one moving at twice the speed of the other.
If there is a loop in the linked list, the two pointers will eventually meet.
To detect the meeting point, we reset one of the pointers to the head of the linked list and move both pointers at the same speed.
The meeting point is the start of the loop.
Q4. How to handle the case when we have a if statement in the macro.(-----)
Q5. Which all software practices that I follow in my current project
Q6. what is LRU, MRU and LFU
LRU, MRU and LFU are caching algorithms used to manage memory in computer systems.
LRU stands for Least Recently Used and removes the least recently used items from the cache when the cache is full.
MRU stands for Most Recently Used and removes the most recently used items from the cache when the cache is full.
LFU stands for Least Frequently Used and removes the least frequently used items from the cache when the cache is full.
All three algorithms are used to optimize memory us...read more
Q7. Find the memory leak in a given set of code.
Identify memory leak in code
Check for any dynamically allocated memory that is not being freed
Look for any infinite loops or recursive functions that consume memory
Use memory profiling tools like Valgrind to detect leaks
Check for any global variables that are not properly managed
Q8. Number of nodes having NULL children in binary tree with N nodes and reason for this value
Q9. Threading: Write and use a mutex?
A mutex is a synchronization primitive that ensures only one thread can access a resource at a time.
Create a mutex object using the appropriate library or language-specific function.
Lock the mutex before accessing the shared resource to prevent other threads from accessing it.
Unlock the mutex after finishing the operation on the shared resource to allow other threads to access it.
Example: pthread_mutex_t mutex; pthread_mutex_init(&mutex, NULL); pthread_mutex_lock(&mutex); // ...read more
Q10. How to check a number is power of 2
To check if a number is a power of 2, we can use bitwise operations.
A power of 2 has only one bit set to 1, so we can use the bitwise AND operator to check if the number is a power of 2.
If n is a power of 2, then n & (n-1) will be 0.
For example, 8 (1000 in binary) is a power of 2, and 8 & 7 (0111 in binary) is 0.
Q11. Check weather array have continuous increasing than decreasing value
Check if array has continuous increasing and decreasing values
Loop through the array and check if each element is greater than the previous one
Once you find the maximum element, check if the remaining elements are in decreasing order
If yes, return true else false
Q12. General bootup process when computer is turned ON
Q13. Converting a number from one base to another, like decimal to hex, binary to hex etc etc
Q14. One line codes, which can cause runtime exceptions
Q15. Sort a stack without using another data structure
Sort a stack without using another data structure
Use recursion to pop the top element and insert it at the bottom of the remaining stack
Repeat until the stack is sorted in ascending order
Time complexity: O(n^2), space complexity: O(n) due to recursion
Q16. Design a class Elevator, should be scalable
Q17. What do you like about product management?
I enjoy the strategic planning, problem-solving, and cross-functional collaboration involved in product management.
I like the opportunity to work on innovative products and bring them to market.
I enjoy analyzing market trends and customer feedback to make data-driven decisions.
I appreciate collaborating with various teams such as engineering, marketing, and sales to ensure successful product launches.
Q18. What is the process of purchase?
The process of purchase involves identifying needs, researching options, making a selection, negotiating terms, and completing the transaction.
Identify the need for a product or service
Research available options and compare prices
Make a selection based on budget and requirements
Negotiate terms such as price, delivery, and payment
Complete the transaction by making the purchase
Q19. camel banana problem
The camel banana problem is a classic puzzle about transporting bananas using a camel.
The puzzle involves a camel, a pile of bananas, and a destination.
The camel can only carry one banana at a time.
The camel cannot walk while carrying a banana.
The goal is to transport all the bananas to the destination using the camel.
The solution involves a series of trips, with the camel carrying one banana at a time.
Q20. Design a cricinfo (LLD)
Design a cricinfo (LLD)
Identify the entities: players, teams, matches, scorecards, tournaments, etc.
Define the relationships between entities
Create a database schema to store the data
Implement APIs to fetch and update data
Design a UI to display the information
Consider scalability and performance
Ensure data security and privacy
Q21. Function to reverse a string
Q22. Hex representation of -17
Q23. Do you know Purhase order?
A purchase order is a document issued by a buyer to a seller, indicating types, quantities, and agreed prices for products or services.
Purchase orders are used in business transactions to ensure both parties are in agreement on the terms of the sale.
They typically include details such as item descriptions, quantities, prices, payment terms, and delivery dates.
Purchase orders help track expenses, manage inventory, and provide a record of transactions.
They are legally binding d...read more
Q24. Xor of 0xFE and 0xEF
Top HR Questions asked in null
Interview Process at null
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month