Top C# Interview Questions and How to Answer Them Like a Pro
shape
Articles related to C interview questions
10 Jan, 2025
Frequently Asked Objective-C Interview Questions
In Objective-C, NSNotificationCenter
is a powerful mechanism that allows objects to communicate with each other in a loose coupling way. It is used to broadcast messages (notifications) to interested objects without the need for them to be directly linked. This is especially useful for event-driven programming and for objects that need to respond to changes or specific events in other parts of the application.
10 Jan, 2025
Must-Know Objective-C Interview Questions and Answers(2025)
In Objective-C (specifically in UIKit), both frame and bounds are properties used to define the position and size of UIView objects, but they are used in different contexts. Understanding their difference is crucial for proper layout management and positioning of UI elements.
10 Jan, 2025
Must-Know Objective-C Interview Questions and Answers
In Objective-C, @selector
is a compiler directive used to represent a selector, which is a type that refers to the name of a method. A selector is essentially a way to refer to a method by its name so that it can be called dynamically during runtime. It is frequently used in contexts like message sending, target-action patterns, and performing selectors.
10 Jan, 2025
Objective-C Interview Questions and Answers(2025)
Method swizzling is an advanced feature in Objective-C that allows you to dynamically change the implementation of a method at runtime. It is a powerful tool that is primarily used for modifying or extending the behavior of existing methods in classes, including system classes or classes for which you don't have the source code.
10 Jan, 2025
Objective-C Interview Questions
Memory management in Objective-C is crucial for ensuring that an application does not leak memory (by failing to release unused objects) or crash (by accessing deallocated objects). Objective-C uses a reference counting model to manage memory, and over the years, this has evolved with the introduction of Automatic Reference Counting (ARC).
10 Jan, 2025
Top Objective-C Interview Questions and Answers(2025)
In Objective-C, @property
is a directive used to declare a property on an object, which is a getter and setter method for an instance variable (ivariable). It allows the automatic creation of accessors (getter and setter methods) and provides encapsulation and memory management for the instance variables, ensuring a clean and simple interface to interact with an object's data.
10 Jan, 2025
Top Objective-C Interview Questions
In Objective-C, @synthesize
is a directive used to automatically generate the getter and setter methods for a property, as well as the instance variable (ivar) associated with that property. However, with the introduction of Automatic Reference Counting (ARC) and modern Objective-C, @synthesize
has become less necessary in most cases, as the compiler now automatically synthesizes properties for you by default. But understanding its historical usage and functionality is still important.
07 Jan, 2025
C Interview Questions and Answers(2025)
In C, error handling is typically done through a combination of return codes, error messages, and sometimes, specialized error-handling functions. C does not provide built-in exceptions like higher-level languages, so error handling in C is generally done in a more manual way. Below are several common techniques for handling errors in C:
07 Jan, 2025
C Programming Interview Questions
A function pointer in C is a pointer that points to a function instead of pointing to a variable. It allows you to store the address of a function and call it indirectly through the pointer. This is useful when you want to pass functions as arguments to other functions, implement callbacks, or handle dynamic function selection at runtime.
07 Jan, 2025
Top C Programming Interview Questions (2025)
Memory management in C is a critical aspect of programming and involves the allocation, usage, and deallocation of memory during program execution. C provides developers with a fine-grained control over memory, unlike higher-level languages that manage memory automatically (e.g., garbage collection in languages like Java or Python). Understanding how memory management works in C is essential for writing efficient and error-free programs.
07 Jan, 2025
Top Mostly Asked C Interview Questions and Answers
A segmentation fault (often referred to as a segfault) in C occurs when a program attempts to access a memory location that it is not allowed to access. This results in a runtime error that usually causes the program to crash. Segmentation faults are typically caused by improper memory access, such as reading from or writing to invalid memory locations.
06 Jan, 2025
C%23 Coding Questions For Technical Interviews
In C#, non-generic collection types are part of the System.Collections namespace. These collections are not type-safe, meaning they can hold elements of any data type. While they are still useful, generics (introduced in C# 2.0) offer better type safety, performance, and readability.
06 Jan, 2025
C++ Interview Questions
C++ is a high-performance, general-purpose programming language that is an extension of the C programming language. It was created by Bjarne Stroustrup in the early 1980s and adds object-oriented programming (OOP) features to C, such as classes, inheritance, polymorphism, and encapsulation.
06 Jan, 2025
C%23 Interview Questions
Method Overloading in C# is a feature that allows a class to have more than one method with the same name, but with different method signatures. This means you can define multiple methods with the same name as long as their parameter lists (number, type, or order of parameters) are different.
06 Jan, 2025
C++ Interview Questions(2025)
Templates in C++ allow for the creation of generic functions and generic classes, enabling code to be written in a way that is independent of data types. Templates allow you to define functions, classes, or structures that can work with any data type, and the type is specified when the function or class is used. This feature helps to create flexible and reusable code that works with different types without duplication.
06 Jan, 2025
C%23 Interview Questions and Answers
Serialization in C# is the process of converting an object into a format that can be easily stored or transmitted, typically into a byte stream. This allows the object to be persisted to storage (like a file or database) or sent over a network to another system. Later, this serialized object can be deserialized, which means converting the byte stream back into an object.
06 Jan, 2025
Example of C++ Interview Questions
Polymorphism is one of the four fundamental principles of Object-Oriented Programming (OOP), the others being encapsulation, inheritance, and abstraction. In C++, polymorphism allows you to use a single interface or function to represent different underlying types. It helps in creating flexible and reusable code.
06 Jan, 2025
Questions from One Job Interview on C++ Developer
Exception handling in C++ is a mechanism that allows a program to detect and respond to runtime errors or exceptional conditions (exceptions) in a controlled way. It involves using special keywords and constructs to catch and handle errors, allowing the program to recover from them or at least terminate gracefully, rather than crashing or behaving unpredictably.
06 Jan, 2025
Top C++ Interview Questions
The inline
keyword in C++ is used to suggest to the compiler that it should attempt to generate inline code for a function call, instead of the normal function call mechanism (i.e., jumping to the function's code location). This can improve performance by avoiding the overhead associated with function calls, especially for small functions that are called frequently.
06 Jan, 2025
Top C# Interview Questions and Answers (2025)
In C#, the this
keyword is a reference to the current instance of the class or struct in which it is used. It is used to access the members (fields, properties, methods) of the current object from within its instance methods or constructors. It provides a way to refer to the current object explicitly, which can be useful to disambiguate between class members and method parameters, or to pass the current object as an argument.
06 Jan, 2025
Top C# Interview Questions(2004)
A jagged array in C# is an array of arrays, where each element of the main array is itself an array. Unlike a multidimensional array, which has a fixed number of rows and columns, a jagged array allows each row (inner array) to have a different length. This provides flexibility in terms of the array's structure.
06 Jan, 2025
Top C# Interview Questions(2005)
A circular reference in C# occurs when two or more objects reference each other, creating a loop of references. This means that Object A references Object B, and Object B references Object A, directly or indirectly. Circular references are typically problematic because they can prevent the garbage collector from reclaiming memory, leading to memory leaks if not handled properly.
06 Jan, 2025
Top C++ Interview Questions and Answers
An abstract class in C++ is a class that cannot be instantiated directly. It is designed to be a base class for other derived classes and contains at least one pure virtual function. The primary purpose of an abstract class is to provide a common interface (set of functions) that other derived classes must implement.
06 Jan, 2025
What Are the Questions Asked in A C++ Interview
The Standard Template Library (STL) is a powerful library in C++ that provides a set of generic classes and functions designed to help with common data structures and algorithms. It allows programmers to efficiently manage collections of data and perform operations like searching, sorting, and manipulating data without having to implement these functionalities from scratch.
29 Dec, 2024
Most Frequently asked wpf Interview Questions (2024)
WPF (Windows Presentation Foundation) is a UI framework developed by Microsoft for building desktop applications on Windows. It provides a modern approach to designing user interfaces, leveraging features like hardware acceleration, 2D and 3D graphics, animation, and multimedia. WPF is based on the .NET Framework (and .NET Core/5+ in later versions) and uses XAML (Extensible Application Markup Language) for defining the UI.
27 Dec, 2024
Most Frequently asked objective-c Interview Questions (2024)
Objective-C is a general-purpose, object-oriented programming language that was created in the early 1980s. It is an extension of the C programming language, adding Smalltalk-style messaging and dynamic runtime features. Objective-C was the primary language for macOS and iOS application development before Swift was introduced by Apple in 2014.
25 Dec, 2024