Windows Programming Interview Questions & Answers

Showing 10 of 31 questions | Page 3

Technical interview questions and answers are essential for a Windows Programming Interview because companies want to test your understanding of Windows API, event handling, message loops, memory management, threading, and GUI development. Windows programming is widely used in desktop applications and enterprise-level software, making it an important skill for developers applying for system-level programming roles. During technical rounds in companies like TCS, Wipro, Infosys, Cognizant, and Capgemini, candidates are often asked fundamental and practical questions about Windows architecture and coding techniques. This guide includes frequently asked Windows Programming interview questions with detailed explanations, making it easier for students and freshers to understand the concepts. These questions will help you improve your technical confidence and prepare better for placement tests and software development interviews.

Showing 10 of 31 questions

21. What are Named Objects?

Method available for sharing kernel objects across process boundaries is to name the objects. Below are the kernel named objects: 1) mutex, 2) Events, 3) semaphore, 4) waitableTimers, 5)file mapping, 6)job object. There are APIs to create these objects with last parameter as the object name

22. What do you mean by unnamed object?

When you are creating the kernel objects with the help of APIs like CreateMutex(, , , ,pzname). And the Pzname parameter is NULL , you are indicating to the system that you want to create an unnamed (anonymous) kernel object. When you create an unnamed object, you can share the object across processes by using either inheritance or DuplicateHandle

23. What is DuplicateHandle (API)?

Takes an entry in one processs handle table and makes a copy of the entry into another processs handle table

24. What is a thread?

A thread describes a path of execution within a process. Every time a process is initialized, the system creates a primary thread. This thread begins executing with the C/C++ run-time librarys startup code, which in turn calls your entry-point function ( main , Wmain , WinMain , or WWinMain ) and continues executing until the entry-point function returns and the C/C++ run-time librarys startup code calls ExitProcess

25. What is the limit on per process for creating a thread?

The number of threads a process can create is limited by the available virtual memory and depends on the default stack size

26. What is Synchronization Objects?

Synchronization object s are use to co-ordinate the execution of multiple threads. Which kernel objects are use for Thread Synchronization on different processes? - Event, Mutex, Semaphore

27. What is Event Object and why it is used?

Event is the thread synchronization object to set signaled state or non-signaled state.

28. What is signaled and non signaled state?

An event is in signaled state means that it has the capacity to release the threads waiting for this event to be signaled. An event is in non signaled state means that it will not release any thread that is waiting for this particular event.example in our project: when user clicks the image application icon double simultaneously. Two image application windows were created. so PAIG created an event and set it to non-signaled state. Then the image application will reset the event to signaled state

29. APIs for creating event and set and reset the events

CreateEvent- to create the event OpenEvent - to open already created event SetEvent - to set the event signaled state RestEvent - To set the Event To non-Signaled State

30. What is Mutex Object and why it is used?

A mutex object is a synchronization object whose state is set to signaled when it is not owned by any thread, and non-signaled when it is owned. For example, to prevent two threads from writing to shared memory at the same time, each thread waits for ownership of a mutex object before executing the code that accesses the memory. After writing to the shared memory, the thread releases the mutex object.
Questions and Answers for Competitive Exams Various Entrance Test