Nucor Interview (C#)

for nucor

18 flashcards · Computer Science · by samuel-howell

  1. Polymorphism?

    Polymorphism is an object-oriented programming concept that refers to the ability of a variable, function, or object to take on multiple forms. In a programming language exhibiting polymorphism, class objects belonging to the same hierarchical tree (inherited from a common parent class) may have functions with the same name, but with different behaviors. class Animal // Base class (parent) { public void animalSound() { Console.WriteLine("The animal makes a sound"); } } class Pig : Animal // Der…

  2. Inheritance?

    In C#, it is possible to inherit fields and methods from one class to another. We group the "inheritance concept" into two categories: Derived Class (child) - the class that inherits from another class Base Class (parent) - the class being inherited from To inherit from a class, use the : symbol. In the example below, the Car class (child) inherits the fields and methods from the Vehicle class (parent): class Vehicle // base class (parent) { public string brand = "Ford"; // Vehicle field public…

  3. Encapsulation?

    Encapsulation refers to an object's ability to hide data and behavior that are not necessary to its user. Encapsulation enables a group of properties, methods and other members to be considered a single unit or object. public class DemoEncap { // private variables declared // these can only be accessed by // public methods of class private String studentName; private int studentAge; // using accessors to get and // set the value of studentName public String Name { get { return studentName; } se…

  4. Advantages to Encapsulation?

    Data Hiding: The user will have no idea about the inner implementation of the class. It will not be visible to the user that how the class is stored values in the variables. He only knows that we are passing the values to accessors and variables are getting initialized to that value. Increased Flexibility: We can make the variables of the class as read-only or write-only depending on our requirement. If we wish to make the variables as read-only then we have to only use Get Accessor in the code…

  5. Abstraction?

    Data abstraction is the process of hiding certain details and showing only essential information to the user. Abstraction can be achieved with either abstract classes or interfaces (which you will learn more about in the next chapter). The abstract keyword is used for classes and methods: Abstract class: is a restricted class that cannot be used to create objects (to access it, it must be inherited from another class). Abstract method: can only be used in an abstract class, and it does not have…

  6. Constructor?

    A constructor is a special method that is used to initialize objects. The advantage of a constructor, is that it is called when an object of a class is created. It can be used to set initial values for fields: // Create a Car class class Car { public string model; // Create a field // Create a class constructor for the Car class public Car() { model = "Mustang"; // Set the initial value for model } static void Main(string[] args) { Car Ford = new Car(); // Create an object of the Car Class (thi…

  7. Method?

    A method is a block of code which only runs when it is called. You can pass data, known as parameters, into a method. Methods are used to perform certain actions, and they are also known as functions. Why use methods? To reuse code: define the code once, and use it many times. class Program { static void MyMethod() { // code to be executed } }

  8. OOP?

    OOP stands for Object-Oriented Programming. Procedural programming is about writing procedures or methods that perform operations on the data, while object-oriented programming is about creating objects that contain both data and methods. Object-oriented programming has several advantages over procedural programming: OOP is faster and easier to execute OOP provides a clear structure for the programs OOP helps to keep the C# code DRY "Don't Repeat Yourself", and makes the code easier to maintain…

  9. Access Modifiers?

    publicThe code is accessible for all classes privateThe code is only accessible within the same class protectedThe code is accessible within the same class, or in a class that is inherited from that class. You will learn more about inheritance in a later chapter internalThe code is only accessible within its own assembly, but not from another assembly. You will learn more about this in a later chapter

  10. Interfaces?

    Another way to achieve abstraction in C#, is with interfaces. An interface is a completely "abstract class", which can only contain abstract methods and properties (with empty bodies): // Interface interface IAnimal { void animalSound(); // interface method (does not have a body) } // Pig "implements" the IAnimal interface class Pig : IAnimal { public void animalSound() { // The body of animalSound() is provided here Console.WriteLine("The pig says: wee wee"); } } class Program { static void Ma…

  11. Enums?

    An enum is a special "class" that represents a group of constants (unchangeable/read-only variables). To create an enum, use the enum keyword (instead of class or interface), and separate the enum items with a comma: enum Months { January, // 0 February, // 1 March, // 2 April, // 3 May, // 4 June, // 5 July // 6 } static void Main(string[] args) { int myNum = (int) Months.April; Console.WriteLine(myNum); }

  12. TCP (Transmission Control Protocol)

    TCP organizes data so that it can be transmitted between a server and a client. It guarantees the integrity of the data being communicated over a network. Before it transmits data, TCP establishes a connection between a source and its destination, which it ensures remains live until communication begins. It then breaks large amounts of data into smaller packets, while ensuring data integrity is in place throughout the process.

  13. UDP (User Datagram Protocol)

    The User Datagram Protocol, or UDP, is a communication protocol used across the Internet for especially time-sensitive transmissions such as video playback or DNS lookups. It speeds up communications by not formally establishing a connection before data is transferred. This allows data to be transferred very quickly, but it can also cause packets to become lost in transit — and create opportunities for exploitation in the form of DDoS attacks.

  14. Ways to reduce technical debt?

    Automated testing. Automated testing reduces code problems because of automated debugging cycles and other processes that scan the code for problems every time a module is updated. Project structure. Project management tools -- such as Trello – can help teams track development statuses and keep on schedule. Monitor code troubles and fix them as quickly as possible. Code-analysis tools such as Sonargraph and Klocwork do this Establish code best practices. Organizations should prepare a coding st…

  15. Is technical debt always bad?

    If the development backlog consists of app improvements rather than fixing bugs, it helps push the application forward, it ould be fine.

  16. Blazor?

    Blazor is an open-source web framework that enables developers to create web apps using C# and HTML

  17. OPC UA

    Open Platform Communications United Architecture is a data exchange standard for industrial communication (machine-to-machine or PC-to-machine communication). This standard is independent of the manufacturer of the app, the programming language in which the app was programmed, the operating system on which the app is running.

  18. Difference between current and earlier versions of OPC UA?

    The biggest difference to previous versions is that machine data can not only be transported, but also semantically described in a machine-readable way.