Siemens
10+ Interview Questions and Answers
Q1. how global variable work , how its shared by all function
Global variables are accessible from any part of the program and can be modified by any function.
Global variables are declared outside of any function.
They can be accessed and modified by any function in the program.
If a function modifies the value of a global variable, the new value is visible to all other functions.
Global variables can be useful for sharing data between functions.
However, overuse of global variables can make code harder to understand and maintain.
Q2. internal implementation of pre and post fix operator
Pre and post fix operators are used to increment or decrement a value before or after it is used in an expression.
Pre-fix operator (++x) increments the value of x and returns the new value.
Post-fix operator (x++) returns the value of x and then increments it.
Both operators can be used with variables of numeric data types.
They can also be used with pointers to increment or decrement the memory address they point to.
Q3. Tell something about app life cycle.
App life cycle refers to the stages an application goes through from installation to removal.
App is installed on a device
App is launched and runs
App goes into background when not in use
App may be terminated by the user or system
App data may be cleared or app uninstalled
Q4. divide a linked list into even and odd without changing order.
Split a linked list into even and odd without changing order.
Create two new linked lists for even and odd numbers.
Iterate through the original linked list and append nodes to respective even or odd lists.
Finally, merge the even and odd lists to get the desired result.
Q5. What about XUnit Testing and NUnit testing difference
XUnit and NUnit are both unit testing frameworks for .NET, with XUnit being newer and more extensible.
XUnit is newer and more extensible compared to NUnit
XUnit uses attributes for test methods while NUnit uses attributes for test fixtures
XUnit does not support TestFixtureSetUp and TestFixtureTearDown like NUnit
XUnit has better support for parallel testing compared to NUnit
Q6. Duplicate variables to be removed in a string
To remove duplicate variables in a string
Iterate through the string and keep track of each character
If a character is already encountered, skip it
Create a new string with non-duplicate characters
Q7. What is listview control
ListView control is a graphical control element used to display a list of items in a vertical, scrollable view.
Used in GUI applications to display a list of items
Allows users to scroll through the list
Can be customized with different layouts and styles
Commonly used in mobile apps and desktop applications
Q8. implement stack data structure
Implement stack data structure
Use an array or linked list to store elements
Push operation adds element to top of stack
Pop operation removes element from top of stack
Peek operation returns top element without removing it
Q9. program to transpose the matrix
Program to transpose a matrix
Iterate through rows and columns of the matrix
Swap the elements at (i,j) and (j,i) positions
Return the transposed matrix
Q10. Explain vectors and array difference
Vectors are dynamic arrays that can change in size, while arrays have a fixed size.
Vectors can grow or shrink in size dynamically, while arrays have a fixed size.
Vectors can be resized using functions like push_back() and pop_back(), while arrays cannot.
Vectors are part of the C++ Standard Template Library (STL), while arrays are a fundamental data structure.
Example: vector
vec; int arr[5];
Q11. What is Micro service ?
Microservices are a software development technique where applications are composed of small, independent services that communicate over well-defined APIs.
Microservices are small, independent services that work together to form a complete application
Each microservice is responsible for a specific function or feature
Microservices communicate with each other over well-defined APIs
Microservices can be developed, deployed, and scaled independently
Examples of companies using micros...read more
Q12. sort 0 1 and 2s in an array
Sort an array of 0s, 1s, and 2s.
Use three pointers to keep track of the positions of 0s, 1s, and 2s.
Traverse the array and swap elements to their respective positions.
Time complexity: O(n), Space complexity: O(1).
Q13. Find duplicates in array
Use a hash set to find duplicates in an array of strings.
Create a hash set to store unique elements.
Iterate through the array and check if each element is already in the hash set.
If it is, then it is a duplicate. If not, add it to the hash set.
Return the duplicates found in the array.
Q14. Explain oop concets
OOP concepts are fundamental principles in object-oriented programming that help in organizing and designing code.
Encapsulation: Bundling data and methods that operate on the data into a single unit (class).
Inheritance: Ability of a class to inherit properties and behavior from another class.
Polymorphism: Ability to present the same interface for different data types.
Abstraction: Hiding the complex implementation details and showing only the necessary features to the outside ...read more
Q15. Design patterns used
Various design patterns like Singleton, Factory, and Observer are used in my projects.
Singleton pattern ensures a class has only one instance and provides a global point of access.
Factory pattern creates objects without specifying the exact class of object that will be created.
Observer pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated.
Interview Process at null
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month