Wabtec
Cheil India Interview Questions and Answers
Q1. What are delegates and why we need it. Which are built in delegates in c#
Delegates are reference types that hold a reference to a method. They are used to achieve loose coupling and event handling.
Delegates allow methods to be passed as parameters to other methods.
They can be used to define callback methods.
Built-in delegates in C# include Action, Func, Predicate, EventHandler, and Comparison.
Action and Func are used for methods that return void and non-void values respectively.
Predicate is used for methods that return a Boolean value.
EventHandler...read more
Q2. What is difference between Dictionary and Hashtable
Dictionary is a generic collection while Hashtable is a non-generic collection.
Dictionary is type-safe while Hashtable is not.
Dictionary allows null keys and values while Hashtable does not.
Dictionary is faster than Hashtable for small collections.
Hashtable is thread-safe while Dictionary is not.
Q3. What are restful services and WebApi and difference between them
RESTful services are web services that follow the REST architecture while WebAPI is a framework for building RESTful services.
RESTful services use HTTP methods like GET, POST, PUT, DELETE to perform CRUD operations on resources
WebAPI is a framework for building RESTful services using .NET framework
WebAPI provides features like routing, model binding, content negotiation, etc.
RESTful services can be consumed by any client that can make HTTP requests
WebAPI can be used to build ...read more
Q4. Write a program to find the number of occurrences in a given string
Program to find the number of occurrences in a given string
Use a loop to iterate through the string and count the occurrences of each character
Store the count in a dictionary or hash table
Return the dictionary or hash table
Q5. Difference between stored procedure and functions
Stored procedures are used to perform a set of actions, while functions return a single value.
Stored procedures can modify data in the database, while functions cannot.
Functions can be used in SQL statements, while stored procedures cannot.
Stored procedures can have input and output parameters, while functions can only have input parameters.
Functions can be called from within stored procedures, but stored procedures cannot be called from within functions.
Q6. How to implement Singleton and Factory pattern in Java
Singleton and Factory patterns are creational patterns used in Java to create objects.
Singleton pattern ensures that only one instance of a class is created and provides a global point of access to it.
Factory pattern provides an interface for creating objects, but allows subclasses to decide which class to instantiate.
Singleton pattern can be implemented using private constructor, static method and static variable.
Factory pattern can be implemented using an interface or abstr...read more
Q7. What are generics in c#
Generics in C# allow for type-safe programming by enabling the creation of reusable code.
Generics allow for the creation of classes, interfaces, and methods that can work with any data type.
They provide type safety by allowing the compiler to enforce type constraints.
Examples include List
, Dictionary , and Nullable . Generics can improve performance by reducing the need for boxing and unboxing operations.
Q8. Most useful annotation used in Spring Boot and Spring JPA
The @Autowired annotation is the most useful annotation used in Spring Boot and Spring JPA.
The @Autowired annotation is used for automatic dependency injection.
It eliminates the need for manual wiring of beans.
It can be used with constructors, fields, and methods.
Example: @Autowired private UserRepository userRepository;
Q9. Internal working principle of Hashmap
Hashmap is a data structure that stores key-value pairs and uses hashing to map keys to their corresponding values.
Hashmap uses an array to store the key-value pairs
A hash function is used to map the key to an index in the array
Collisions can occur when two keys map to the same index, which can be resolved using techniques like chaining or open addressing
Hashmap provides constant time complexity for insertion, deletion, and retrieval of key-value pairs
Interview Process at Cheil India
Top Senior Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month