Add office photos
Employer?
Claim Account for FREE

NCR Voyix

3.9
based on 1.5k Reviews
Filter interviews by

10+ Johnson Controls Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. What are interfaces and what is difference between an interface and abstract class

Ans.

Interfaces define a contract for behavior, while abstract classes provide partial implementation.

  • Interfaces only define method signatures, while abstract classes can have both abstract and concrete methods.

  • A class can implement multiple interfaces, but can only inherit from one abstract class.

  • Interfaces are used for loose coupling and flexibility in design.

  • Abstract classes are used for code reuse and to enforce a common implementation among subclasses.

Add your answer

Q2. what is difference between stored procedure and function

Ans.

Stored procedures are used to perform a set of actions, while functions return a single value.

  • Stored procedures are precompiled and stored in the database, while functions are compiled at runtime.

  • Functions can be used in SQL statements, while stored procedures cannot be used in SQL statements.

  • Functions can be called from within stored procedures, but stored procedures cannot be called from within functions.

Add your answer

Q3. what is difference between virtual and override keywords

Ans.

Virtual keyword is used to declare a method in a base class that can be overridden in a derived class. Override keyword is used in the derived class to override the implementation of the virtual method.

  • Virtual keyword is used in the base class to declare a method that can be overridden in the derived class

  • Override keyword is used in the derived class to override the implementation of the virtual method

  • Virtual methods provide a way for a base class to define a default implemen...read more

Add your answer

Q4. what are solid principles and explain them

Ans.

SOLID principles are a set of five design principles for writing maintainable and scalable code.

  • Single Responsibility Principle (SRP) - a class should have only one reason to change

  • Open-Closed Principle (OCP) - a class should be open for extension but closed for modification

  • Liskov Substitution Principle (LSP) - subtypes should be substitutable for their base types

  • Interface Segregation Principle (ISP) - clients should not be forced to depend on interfaces they do not use

  • Depend...read more

Add your answer
Discover Johnson Controls interview dos and don'ts from real experiences

Q5. Program to find the second largest element from a 4-digit number, ex: input 1245 return 4

Ans.

Program to find the second largest element from a 4-digit number

  • Convert the number to a string and split it into an array of characters

  • Sort the array in descending order

  • Return the second element of the array

Add your answer

Q6. what is a singleton design pattern

Ans.

Singleton design pattern restricts the instantiation of a class to a single instance and provides a global point of access to it.

  • Used when only one instance of a class is required throughout the system

  • Provides a global point of access to the instance

  • Implemented using a private constructor, static method, and static variable

  • Example: Logger class, Database connection class

Add your answer
Are these interview questions helpful?

Q7. does c# support multiple inheritence

Ans.

No, C# does not support multiple inheritance.

  • C# only supports single inheritance, where a class can inherit from only one base class.

  • However, C# does support multiple interface inheritance, where a class can implement multiple interfaces.

  • This is achieved using the 'interface' keyword instead of 'class'.

Add your answer

Q8. how routing is done in mvc

Ans.

Routing in MVC is done through the use of routes, which map URLs to controller actions.

  • Routes are defined in the RouteConfig.cs file in the App_Start folder

  • Routes consist of a URL pattern and a corresponding controller action

  • Routes can also include optional parameters and constraints

  • Routing is done through the use of the ASP.NET routing engine

  • Routing can be customized by creating custom route handlers

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. what is singleton design pattern

Ans.

Singleton design pattern restricts the instantiation of a class to a single instance and provides a global point of access to it.

  • Used when only one instance of a class is required throughout the system

  • Provides a global point of access to the instance

  • Implemented using a private constructor, static method, and static variable

  • Example: Logger class in Java

Add your answer

Q10. what are extension methods

Ans.

Extension methods are static methods that allow adding new functionality to existing types without modifying the original type.

  • Extension methods are defined in a static class.

  • They must be declared with the 'this' keyword before the first parameter.

  • They can be called as if they were instance methods of the extended type.

  • Extension methods can be used to add functionality to built-in types or custom types.

  • Example: adding a method to the string type to convert a string to title c...read more

Add your answer

Q11. what are filters in mvc

Ans.

Filters in MVC are used to intercept and modify HTTP requests and responses.

  • Filters can be used to implement authentication and authorization.

  • They can also be used for caching and logging.

  • Examples of filters include AuthorizationFilter, ActionFilter, and ExceptionFilter.

Add your answer

Q12. what are indexes in sql

Ans.

Indexes in SQL are used to improve the performance of queries by allowing faster data retrieval.

  • Indexes are created on one or more columns of a table.

  • They work like a book index, allowing the database to quickly find the data.

  • Indexes can be clustered or non-clustered.

  • Clustered indexes determine the physical order of data in a table.

  • Non-clustered indexes create a separate structure to store the index data.

  • Indexes should be used carefully as they can slow down data modification...read more

Add your answer

Q13. what is dependency injection

Ans.

Dependency injection is a design pattern used to remove hard-coded dependencies and make code more modular and testable.

  • Dependency injection involves injecting dependencies into a class rather than having the class create them itself.

  • This allows for easier testing and swapping out of dependencies.

  • There are three types of dependency injection: constructor injection, setter injection, and interface injection.

  • Examples of dependency injection frameworks include Spring and Guice.

Add your answer

Q14. explain about dependency injection

Ans.

Dependency injection is a design pattern that allows objects to receive dependencies from external sources rather than creating them internally.

  • Dependency injection helps to decouple components and make them more reusable and testable.

  • There are three types of dependency injection: constructor injection, setter injection, and interface injection.

  • Example: Instead of creating a database connection object inside a class, we can inject it from outside.

  • Dependency injection framewor...read more

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter