Broadcom
Gyproc Interview Questions and Answers
Q1. what are processes and threads memory is allocated to what process or threads? what is mutex and semaphore how many threads/process can you launch at a time what is meaning of core in 4-core system what is cont...
read moreProcesses and threads are units of execution in a computer system. Memory is allocated to processes. Mutex and semaphore are synchronization mechanisms. Core refers to a processing unit in a multi-core system. Context switching is the process of switching between different processes or threads.
Processes are independent units of execution with their own memory space and resources.
Threads are lightweight units of execution within a process, sharing the same memory space.
Memory ...read more
Q2. Runtime polymorphism and how it works vptr and vtable
Runtime polymorphism in C++ is achieved through virtual functions, vptr (virtual pointer), and vtable (virtual table).
Runtime polymorphism allows objects of different classes to be treated as objects of a common superclass.
Virtual functions are declared in a base class and overridden in derived classes to achieve polymorphism.
vptr is a pointer that points to the vtable of an object, allowing dynamic binding of virtual functions at runtime.
vtable is a table of function pointer...read more
Q3. what is dynamic_cast where it can fail and what will happen in that case
dynamic_cast is a C++ operator used for safe downcasting of pointers and references in polymorphic classes.
dynamic_cast is used to safely downcast a pointer or reference from a base class to a derived class.
It can fail if the object being casted is not of the target type, in which case it returns a null pointer for pointers or throws a std::bad_cast exception for references.
Dynamic_cast can only be used with pointers or references to polymorphic classes (classes that have at ...read more
Q4. have you used any windows api's?
Yes, I have used Windows API's extensively in my previous projects.
I have used Windows API's for tasks such as creating windows, handling messages, and interacting with system resources.
Examples include using functions like CreateWindow, SendMessage, and ReadFile.
I have also worked with specific Windows API's like Winsock for networking and WinINet for internet-related tasks.
Q5. Which version of c++ you use
I primarily use C++17, but I am familiar with earlier versions as well.
I am comfortable working with features introduced in C++17 such as structured bindings and constexpr if
I have experience with earlier versions like C++11 and C++14
I stay updated with the latest features and improvements in C++ standards
Q6. what is union in c++
Union in C++ is a data structure that allows storing different data types in the same memory location.
Unions are similar to structures but all members share the same memory location.
Only one member of a union can be accessed at a time.
Unions are useful when you need to store different data types in the same memory space.
Example: union MyUnion { int i; float f; };
Example: MyUnion u; u.i = 10; // Accessing integer member of the union
Q7. what is weak pointer
Weak pointer is a type of smart pointer in C++ that does not control the lifetime of the object it points to.
Weak pointers are used to break circular references in shared pointers.
They do not increase the reference count of the object.
They are used in scenarios where the object may be deleted while there are still weak pointers pointing to it.
More about working at Broadcom
Interview Process at Gyproc
Reviews
Interviews
Salaries
Users/Month