Risk Management. I.T. Mock Interview Correction

Size: px
Start display at page:

Download "Risk Management. I.T. Mock Interview Correction"

Transcription

1 Risk Management I.T. Mock Interview Correction General I.T. Questions 1) A computer can only run binary code, whose human-readable version is assembly language. Any higher-level language is only an abstraction developed in order to ease software development, and must eventually be transformed to binary instructions. There are mainly two approaches to do so: compiled languages (e.g. C and C++): the high-level language need to be integrally converted to binary code once the application source code is ready, so as to make it runnable. The developer generally takes care about this one-step process once she wants to publish the application. Compiled softwares are generally fast as they are directly runnable without any need of further conversion procedure; also, the compiler may analyse the whole source code and optimize it. However, compiled languages are less flexible in terms of development as the developer needs to recompile the application each and every time she makes any modification in the source code; debugging is also generally less explicit than with interpreted languages. Still, the developer knows at the time of the compilation if she made (static) errors such as syntax errors, or typing errors (if the language is statically typed). Notably, compiled languages are architecturespecific and need to be recompiled for every environment they target. interpreted languages (e.g. VB, VBA, MatLab, Javascript): the source code is shipped as is, and a tool called interpreter takes care about dynamically converting the source code to binary as the application runs. This live translation service consumes computing power, however, which makes interpreted languages slower than compiled language most of the time; also, it is harder for the interpreter to optimize the code as it does not consider the code integrally in general. Still, its dynamic nature helps the developer which can easily modify and relaunch the application without the painful process of compilation; she may also directly run commands in a shell-like environment (think of MatLab), as the commands may be converted to binary code immediately. Debugging tools are generally of a higher level and provide more information to the developer about the state of the application and the execution flow. Finally, a software may be launched on any environment providing an interpreter without any further complications, but this also implies that the application cannot run if the interpreter has not been previously installed. just-in-time compiled languages (e.g. C#, VB.NET, Java): the high-level language is first compiled to an intermediary - but low level - language at the end of the development phase, e.g. so called byte code for Java or MSIL for C# and VB.NET. The intermediary language keeps general enough to not be architecture specific, however. Once the application is run on the client computer, a just-in-time compiler takes care of the final step, which is generally performed only once (when the application is first run): compiling the intermediary language to binary code. The just-in-time compiler may even benefit from its knowledge of the computer architecture to further optimize the compiled code. As for the interpreted languages, the application may be run on any environment providing a just-in-time compiler (and the required libraries) without the need to recompile, but it also means that the just-in-time compiler and the other required libraries must have been previously installed. 2) Debugging is the process of the process of finding bugs, or errors, in the application. Some errors are qualified of static as they may be found during the programming phase (e.g. syntax

2 errors) but others, called dynamic errors, might only reveal themselves as the application is run (e.g. a division by zero). Static errors are generally captured during the compilation phase, and are generally easy to spot and correct even with interpreted languages during the execution. Dynamic errors depend on the state of the application during its execution (i.e. the content of each and every variable related to your application) and it is much harder to identify the cause of a crash in this context, as it may be the consequence of a series of complex operations (even pseudo nondeterminist in the case of naive multithreading). Languages development environment generally provide tools to debug the application while it is running. They allow to set breakpoints, where the application should pause, so that the developer can inspect the state of the application and assert its correctness. More advanced tools allow the developer to run the application line by line to follow the execution process precisely and identify the cause of a misconduct (note that in case of parallelism, this is not as straightforward). High-level language provide programming paradigms to capture as soon as possible the potential causes of dynamic errors, such as exception handling mechanisms, but this does not prevent errors made by the developer. Unit testing is the fact of developing a side application whose only goal is to check as many aspects of the behavior of the main application. The unit testing application is run every time the main application is modified, so that it immediately notifies the developer of a feature which ceased to worked because of a modification. Indeed, it is important to realize that industrial applications might have millions of lines of code, which makes them impossible to be understood by a single programmer. The development process is splitted between many teams, which try to work in common but might still corrupt the work of each other as there are a lot of cross dependencies. In any case, even on a single-developer project, the programmer quickly loses the absolute control of her project as the state-space and the external dependencies grow very fast: it is primordial to develop a tool which can systematically test as many features of the application and alert the developer as soon as one of them is corrupt. 3) The type of a variable defines the kind of content it may store, e.g. integers, characters, floating numbers, strings. A strong typing system forces the programmer to explicitly state the type of the variables she uses, and forbids any illegal operation between incompatible types (e.g. trying to store a floating number in a character-typed variable, or trying to add a number and a string); this prevents many errors which may result in an undetermined state of the application. Indeed, if such an operation occurs, it is generally a mistake made by the programmer, or at least it could lead to ambiguities: it is therefore generally a better idea to notify the programmer. Weak typing is much more flexible and tries to guess what would be the best solution to operations involving incompatible types. For instance, adding the number 3 and the character 4 might be automatically transformed by the compiler (or interpreter) by adding the number 3 and the number 4 ; but it is ambiguous as one may also argue that is no more logical than adding the number 3 and the ASCII code of 4, which is 52 : the results of these two operations are completely different. In this particular case, it would be enough to simply read the language manual and find out what is the standard procedure in case of an operation between an integer and a character, but it might become much less clear is other cases. Worse, if you happen to forget this subtlety, and wrongly think that a character is converted to a number using its ASCII code, you will assume that the variable contains 3+ASCII( 4 ) even though it contains 3+4: the application won t crash, but you will certainly have a bug occurrence much later in the execution of the software and it will be very hard to come back to the genesis of the error. In other words, weak typing is quite comfortable for (lazy) programmers but it is much safer to use strong typing. Visual Basic is an example of weak typing language; C++, Java, C# are strong typing languages.

3 Statically typed languages perform the type check at the time of the compilation once and for all, whereas dynamically typed languages check the correctness of the operation types at runtime only. Statically typed languages have the advantage that any typing error is found early; also, the development tools may analyse the typing structure of the source code and provide help or advices to the programmer (e.g. IntelliSense of VisualStudio). Dynamically typed languages are less strict for the programmer in the sense that he does not need to bother specifying each and every type, but it does not prevent an error occurring during the execution. 4) Passing a parameter by value to a function may somehow be understood as passing a copy of the variable to the function. In other words, if the inner code of the function modifies the parameter, it will not have any impact on the outer variable. Passing a parameter by reference means that it is the outer variable that will be accessed from inside the function: any modification on a parameter passed by reference will impact the outer variable. For instance, consider the pseudocode a function which swaps the content of its parameters: function swap(byval A, byval B) var C = A; A = B; B = C; end function X = 1; Y = 2; swap(x, Y); The final call swap(x,y) does not work as expected as the inner code of the swap function only deals with local copies A and B or the variables X and Y, and the instructions A=B and B=C have no effect on X and Y. X and Y still have the values 1 and 2 after the swap call, respectively. However, a function such as: function swap(byref A, byref B) var C = A; A = B; B = C; end function X=1; Y=2; swap(x,y); will do a proper job as now A and B actually refer to the outer variables passed as parameters. The value of X and Y is 2 and 1 after the swap call, respectively. 5) Memory management mainly involves the dynamic allocation and cleanup of memory. High level languages generally hide the rather complex mechanisms of explicit memory management by providing abstractions and tools which care about these concepts automatically without requiring any attention of the developer. For instance, the developer might deal with an array of data (creating, deleting or resizing it) without asking explicitly the system to allocate some number of octets and without taking care of its removal once she is done with it. A garbage collector is a tool whose unique goal is to identify allocated variables which are no longer in

4 use, and free the memory associated to them automatically. MatLab, VisualBasic, Java and C# do provide some advanced memory management facilities (not to the same extent however), whereas C and C++ do not, for instance. Explicit memory management is a terrible source of bugs (think of segment fault-type errors, buffer overflows, or memory leaks) and are also sources of vulnerabilities to malicious softwares (e.g. buffer overflow attacks). However, when the performance of a software is crucial, automatic memory management might be weaker as the developer loses control over the execution flow of a part of the program (e.g. she has no control over the execution of the garbage collector). 6) A memory pointer is a variable whose content is the address in memory of another variable. There are generally no pointers in automatic memory management languages as the main goal of pointers is to deal with allocation of memory (note that C# still allows to use pointers in a restricted context). The main uses of pointers are the following: storing the address of a block of memory, which has for instance been allocated by the developer passing parameters by reference (or more explicitly, passing by pointer) to a function so that the inner code may modify the content of the outer variables, or to avoid the copy of heavy variables returning the address of an object dynamically allocated in the inner code of a function dealing with the array arithmetics (e.g. accessing elements) 7) Procedural programming is a paradigm in which the source code mainly consists of procedure (i.e. function) calls, and is otherwise of a very linear nature. Object oriented programming is a paradigm in which tasks are structured in data types (called classes) and are associated to behaviors (methods, or class functions) and properties (members, or class variables). The classes may be instantiated to create objects, which are unique entities based on the class model, are self-contained and have their own state. OOP generally provides more advanced tools such as inheritance, polymorphism and encapsulation, which help design a secure, robust, elegant, modulable and extensible code. C++, C#, Java and Scala do support OOP whereas C for instance, does not. MatLab supports OOP since a recent version, but it only has basic OOP features, so it is clearly not fully OOP. 8) Linked lists, dynamic arrays, hashtables and binary trees are data structure which help store collections of data efficiently. Depending on the use the developer needs (e.g. a fast access to random elements, a fast resize of the structure, a fast insertion of element at an arbitrary position, etc.), some of these structures are more efficient than others. Each of these structures has its strengths and its weaknesses relative to different operations, therefore the developer has to decide carefully which one suits the best her use case. For instance, matrices in MatLab require a fast access to an arbitrary element, but are rarely resized once they have been created; for this reason, the underlying data structure will try to have the lowest order of complexity for accessing arbitrary elements, at the cost of having a higher complexity for resizing operations. linked lists: each element of the collection stores the value of interest plus a pointer to the next element (and potentially a second pointer to the previous element). The developer always keeps track of the address of the first element. This data structure is ideal in order to insert a new data in the collection as is suffices to only alter the pointer of the previous element (if the pointer to such element is known), which is of O(1). However, it is slow for random access (of O(N)), as it does not know where is stored the Nth element in memory unless it first goes successively through the pointer of the 1st element to the 2nd, and then from the 2nd to the 3rd, etc. until the Nth.

5 dynamic arrays: a block of memory of size N is allocated initially, and the elements can be accessed in O(1) using arithmetics as the variables are stored successively in memory. However, inserting an element in the collection (say, at a position i) can be very costly: if the allocated memory is sufficient to insert a new item, a first step requires to shift all the items from position i one block on the right, and only then write the new element at the position i. If the memory allocated initially is not sufficient to add a new item, a new full block of size N+k (e.g. k=1) must be allocated, and the old data structure must be fully copied in the new memory block, inserting the new element at the right place; finally, the old block of size N must be freed. MatLab matrices are implemented using this kind of structure (even though they are certainly more complex). 9) A design pattern is the solution to a recurrent problem in the context of software engineering. As for algorithms, it is not specific to a particular language, but is rather a generalist best practice guide; still, it often requires OOP features and might therefore be useless for procedural languages. The singleton design pattern gives the solution to the problem of authorizing one instance of a particular class only and takes the following form (in C#): class Foo { private static Foo uniqueinstance = null; private Foo() { } public static Foo Get() { if( uniqueinstance == null ) uniqueinstance = new Foo(); return uniqueinstance; } } Foo f1 = Foo.Get(); Foo f2 = Foo.Get(); // f2 is the same object than f1 (not just a copy) Foo f = new Foo(); // Illegal, does not compile MatLab Questions 1) MatLab is interpreted, dynamically typed and mostly strongly typed. It provides some poor OOP as well as some very basic FP features. It does provide automatic memory management facilities. By default, it passes the parameters by value. 2) A vector (or matrix) contains a unique data type, and is optimized for linear algebra operations. A cell array is more flexible in the sense that it may mix any (complex) types for each of its elements without restriction, but it is less suited for numerical calculus. Vectors and matrices are implemented in a dynamic array-like data structure type for the reasons given above. 3) Method overloading allows to declare several methods with the same name but differing in their number of parameters (or their parameter types), therefore having a potentially different body. MatLab provides a cheap version of overloading: the programmer may use the variable nargin in the function to know how many parameters have been set when the function

6 was called. This way, the inner code of the function might react differently if some parameters are missing. In order to capture the 3rd return parameter of the function but not the 2 first parameters, the syntax is: [~,~,third] = somefunction(someparam); 4) See int2str, str2int, datestr, datenum. 5) See sub2ind, ind2sub.

[0569] p 0318 garbage

[0569] p 0318 garbage A Pointer is a variable which contains the address of another variable. Declaration syntax: Pointer_type *pointer_name; This declaration will create a pointer of the pointer_name which will point to the

More information

Chapter 1 INTRODUCTION SYS-ED/ COMPUTER EDUCATION TECHNIQUES, INC.

Chapter 1 INTRODUCTION SYS-ED/ COMPUTER EDUCATION TECHNIQUES, INC. hapter 1 INTRODUTION SYS-ED/ OMPUTER EDUATION TEHNIQUES, IN. Objectives You will learn: Java features. Java and its associated components. Features of a Java application and applet. Java data types. Java

More information

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc.

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc. Chapter 1 GETTING STARTED SYS-ED/ Computer Education Techniques, Inc. Objectives You will learn: Java platform. Applets and applications. Java programming language: facilities and foundation. Memory management

More information

Programming Style and Optimisations - An Overview

Programming Style and Optimisations - An Overview Programming Style and Optimisations - An Overview Summary In this lesson we introduce some of the style and optimization features you may find useful to understand as a C++ Programmer. Note however this

More information

D Programming Language

D Programming Language Group 14 Muazam Ali Anil Ozdemir D Programming Language Introduction and Why D? It doesn t come with a religion this is written somewhere along the overview of D programming language. If you actually take

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

Heap Management. Heap Allocation

Heap Management. Heap Allocation Heap Management Heap Allocation A very flexible storage allocation mechanism is heap allocation. Any number of data objects can be allocated and freed in a memory pool, called a heap. Heap allocation is

More information

Structure of Programming Languages Lecture 10

Structure of Programming Languages Lecture 10 Structure of Programming Languages Lecture 10 CS 6636 4536 Spring 2017 CS 6636 4536 Lecture 10: Classes... 1/23 Spring 2017 1 / 23 Outline 1 1. Types Type Coercion and Conversion Type Classes, Generics,

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

CSE 307: Principles of Programming Languages

CSE 307: Principles of Programming Languages CSE 307: Principles of Programming Languages Variables and Constants R. Sekar 1 / 22 Topics 2 / 22 Variables and Constants Variables are stored in memory, whereas constants need not be. Value of variables

More information

Hacking in C. Pointers. Radboud University, Nijmegen, The Netherlands. Spring 2019

Hacking in C. Pointers. Radboud University, Nijmegen, The Netherlands. Spring 2019 Hacking in C Pointers Radboud University, Nijmegen, The Netherlands Spring 2019 Allocation of multiple variables Consider the program main(){ char x; int i; short s; char y;... } What will the layout of

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

Operating Systems CMPSCI 377, Lec 2 Intro to C/C++ Prashant Shenoy University of Massachusetts Amherst

Operating Systems CMPSCI 377, Lec 2 Intro to C/C++ Prashant Shenoy University of Massachusetts Amherst Operating Systems CMPSCI 377, Lec 2 Intro to C/C++ Prashant Shenoy University of Massachusetts Amherst Department of Computer Science Why C? Low-level Direct access to memory WYSIWYG (more or less) Effectively

More information

Question No: 1 ( Marks: 1 ) - Please choose one One difference LISP and PROLOG is. AI Puzzle Game All f the given

Question No: 1 ( Marks: 1 ) - Please choose one One difference LISP and PROLOG is. AI Puzzle Game All f the given MUHAMMAD FAISAL MIT 4 th Semester Al-Barq Campus (VGJW01) Gujranwala faisalgrw123@gmail.com MEGA File Solved MCQ s For Final TERM EXAMS CS508- Modern Programming Languages Question No: 1 ( Marks: 1 ) -

More information

Client Code - the code that uses the classes under discussion. Coupling - code in one module depends on code in another module

Client Code - the code that uses the classes under discussion. Coupling - code in one module depends on code in another module Basic Class Design Goal of OOP: Reduce complexity of software development by keeping details, and especially changes to details, from spreading throughout the entire program. Actually, the same goal as

More information

Seminar report Java Submitted in partial fulfillment of the requirement for the award of degree Of CSE

Seminar report Java Submitted in partial fulfillment of the requirement for the award of degree Of CSE A Seminar report On Java Submitted in partial fulfillment of the requirement for the award of degree Of CSE SUBMITTED TO: www.studymafia.org SUBMITTED BY: www.studymafia.org 1 Acknowledgement I would like

More information

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction Lecture 13: Object orientation Object oriented programming Introduction, types of OO languages Key concepts: Encapsulation, Inheritance, Dynamic binding & polymorphism Other design issues Smalltalk OO

More information

Deallocation Mechanisms. User-controlled Deallocation. Automatic Garbage Collection

Deallocation Mechanisms. User-controlled Deallocation. Automatic Garbage Collection Deallocation Mechanisms User-controlled Deallocation Allocating heap space is fairly easy. But how do we deallocate heap memory no longer in use? Sometimes we may never need to deallocate! If heaps objects

More information

EL2310 Scientific Programming

EL2310 Scientific Programming Lecture 11: Structures and Memory (yaseminb@kth.se) Overview Overview Lecture 11: Structures and Memory Structures Continued Memory Allocation Lecture 11: Structures and Memory Structures Continued Memory

More information

https://lambda.mines.edu Evaluating programming languages based on: Writability: How easy is it to write good code? Readability: How easy is it to read well written code? Is the language easy enough to

More information

Type Bindings. Static Type Binding

Type Bindings. Static Type Binding Type Bindings Two key issues in binding (or associating) a type to an identifier: How is type binding specified? When does the type binding take place? N. Meng, S. Arthur 1 Static Type Binding An explicit

More information

Sample Copy. Not for Distribution.

Sample Copy. Not for Distribution. A Practical Approach to Learn JAVA i EDUCREATION PUBLISHING RZ 94, Sector - 6, Dwarka, New Delhi - 110075 Shubham Vihar, Mangla, Bilaspur, Chhattisgarh - 495001 Website: www.educreation.in Copyright, 2018,

More information

Data Types. Every program uses data, either explicitly or implicitly to arrive at a result.

Data Types. Every program uses data, either explicitly or implicitly to arrive at a result. Every program uses data, either explicitly or implicitly to arrive at a result. Data in a program is collected into data structures, and is manipulated by algorithms. Algorithms + Data Structures = Programs

More information

Examples of Code Roaches. First Draft List Cem Kaner September 11, 2005

Examples of Code Roaches. First Draft List Cem Kaner September 11, 2005 Examples of Code Roaches First Draft List Cem Kaner September 11, 2005 Why a Potential-Bug List? Given a potential error, you can develop a method to test for it Foundation for Code inspections Glass box

More information

CPS 506 Comparative Programming Languages. Programming Language

CPS 506 Comparative Programming Languages. Programming Language CPS 506 Comparative Programming Languages Object-Oriented Oriented Programming Language Paradigm Introduction Topics Object-Oriented Programming Design Issues for Object-Oriented Oriented Languages Support

More information

Pointers and References

Pointers and References Steven Zeil October 2, 2013 Contents 1 References 2 2 Pointers 8 21 Working with Pointers 8 211 Memory and C++ Programs 11 212 Allocating Data 15 22 Pointers Can Be Dangerous 17 3 The Secret World of Pointers

More information

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS Chapter 1 : Chapter-wise Java Multiple Choice Questions and Answers Interview MCQs Java Programming questions and answers with explanation for interview, competitive examination and entrance test. Fully

More information

Principles of Programming Languages. Lecture Outline

Principles of Programming Languages. Lecture Outline Principles of Programming Languages CS 492 Lecture 1 Based on Notes by William Albritton 1 Lecture Outline Reasons for studying concepts of programming languages Programming domains Language evaluation

More information

Lecture Notes on Memory Management

Lecture Notes on Memory Management Lecture Notes on Memory Management 15-122: Principles of Imperative Computation Frank Pfenning Lecture 21 April 5, 2011 1 Introduction Unlike C0 and other modern languages like Java, C#, or ML, C requires

More information

Vector and Free Store (Pointers and Memory Allocation)

Vector and Free Store (Pointers and Memory Allocation) DM560 Introduction to Programming in C++ Vector and Free Store (Pointers and Memory Allocation) Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark [Based on slides

More information

I101/B100 Problem Solving with Computers

I101/B100 Problem Solving with Computers I101/B100 Problem Solving with Computers By: Dr. Hossein Hakimzadeh Computer Science and Informatics IU South Bend 1 What is Visual Basic.Net Visual Basic.Net is the latest reincarnation of Basic language.

More information

QUIZ. What is wrong with this code that uses default arguments?

QUIZ. What is wrong with this code that uses default arguments? QUIZ What is wrong with this code that uses default arguments? Solution The value of the default argument should be placed in either declaration or definition, not both! QUIZ What is wrong with this code

More information

CS112 Lecture: Primitive Types, Operators, Strings

CS112 Lecture: Primitive Types, Operators, Strings CS112 Lecture: Primitive Types, Operators, Strings Last revised 1/24/06 Objectives: 1. To explain the fundamental distinction between primitive types and reference types, and to introduce the Java primitive

More information

9/7/17. Outline. Name, Scope and Binding. Names. Introduction. Names (continued) Names (continued) In Text: Chapter 5

9/7/17. Outline. Name, Scope and Binding. Names. Introduction. Names (continued) Names (continued) In Text: Chapter 5 Outline Name, Scope and Binding In Text: Chapter 5 Names Variable Binding Type bindings, type conversion Storage bindings and lifetime Scope Lifetime vs. Scope Referencing Environments N. Meng, S. Arthur

More information

Systems software design. Software build configurations; Debugging, profiling & Quality Assurance tools

Systems software design. Software build configurations; Debugging, profiling & Quality Assurance tools Systems software design Software build configurations; Debugging, profiling & Quality Assurance tools Who are we? Krzysztof Kąkol Software Developer Jarosław Świniarski Software Developer Presentation

More information

Lecture Notes on Memory Management

Lecture Notes on Memory Management Lecture Notes on Memory Management 15-122: Principles of Imperative Computation Frank Pfenning Lecture 22 November 11, 2010 1 Introduction Unlike C0 and other modern languages like Java, C#, or ML, C requires

More information

Business and Scientific Applications of the Java Programming Language

Business and Scientific Applications of the Java Programming Language Business and Scientific Applications of the Java Programming Language Angelo Bertolli April 24, 2005 Abstract While Java is arguably a good language with that to write both scientific and business applications,

More information

QUIZ on Ch.5. Why is it sometimes not a good idea to place the private part of the interface in a header file?

QUIZ on Ch.5. Why is it sometimes not a good idea to place the private part of the interface in a header file? QUIZ on Ch.5 Why is it sometimes not a good idea to place the private part of the interface in a header file? Example projects where we don t want the implementation visible to the client programmer: The

More information

QUIZ Friends class Y;

QUIZ Friends class Y; QUIZ Friends class Y; Is a forward declaration neeed here? QUIZ Friends QUIZ Friends - CONCLUSION Forward (a.k.a. incomplete) declarations are needed only when we declare member functions as friends. They

More information

10. Functions (Part 2)

10. Functions (Part 2) 10.1 Overloaded functions 10. Functions (Part 2) In C++, two different functions can have the same name if their parameters are different; either because they have a different number of parameters, or

More information

Object-Oriented Programming

Object-Oriented Programming Object-Oriented Programming 1. What is object-oriented programming (OOP)? OOP is a technique to develop logical modules, such as classes that contain properties, methods, fields, and events. An object

More information

Security Coding Module - Buffer Overflow Data Gone Wild CS1

Security Coding Module - Buffer Overflow Data Gone Wild CS1 Security Coding Module - Buffer Overflow Data Gone Wild CS1 Background Summary: Buffer overflow occurs when data is input or written beyond the allocated bounds of an buffer, array, or other object causing

More information

What are the characteristics of Object Oriented programming language?

What are the characteristics of Object Oriented programming language? What are the various elements of OOP? Following are the various elements of OOP:- Class:- A class is a collection of data and the various operations that can be performed on that data. Object- This is

More information

CSC 533: Organization of Programming Languages. Spring 2005

CSC 533: Organization of Programming Languages. Spring 2005 CSC 533: Organization of Programming Languages Spring 2005 Language features and issues variables & bindings data types primitive complex/structured expressions & assignments control structures subprograms

More information

C++ & Object Oriented Programming Concepts The procedural programming is the standard approach used in many traditional computer languages such as BASIC, C, FORTRAN and PASCAL. The procedural programming

More information

Engine Support System. asyrani.com

Engine Support System. asyrani.com Engine Support System asyrani.com A game engine is a complex piece of software consisting of many interacting subsystems. When the engine first starts up, each subsystem must be configured and initialized

More information

Topic 9: Type Checking

Topic 9: Type Checking Recommended Exercises and Readings Topic 9: Type Checking From Haskell: The craft of functional programming (3 rd Ed.) Exercises: 13.17, 13.18, 13.19, 13.20, 13.21, 13.22 Readings: Chapter 13.5, 13.6 and

More information

Topic 9: Type Checking

Topic 9: Type Checking Topic 9: Type Checking 1 Recommended Exercises and Readings From Haskell: The craft of functional programming (3 rd Ed.) Exercises: 13.17, 13.18, 13.19, 13.20, 13.21, 13.22 Readings: Chapter 13.5, 13.6

More information

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17 List of Programs xxv List of Figures xxix List of Tables xxxiii Preface to second version xxxv PART 1 Structured Programming 1 1 Getting started 3 1.1 Programming 3 1.2 Editing source code 5 Source code

More information

Computer Components. Software{ User Programs. Operating System. Hardware

Computer Components. Software{ User Programs. Operating System. Hardware Computer Components Software{ User Programs Operating System Hardware What are Programs? Programs provide instructions for computers Similar to giving directions to a person who is trying to get from point

More information

Arrays array array length fixed array fixed length array fixed size array Array elements and subscripting

Arrays array array length fixed array fixed length array fixed size array Array elements and subscripting Arrays Fortunately, structs are not the only aggregate data type in C++. An array is an aggregate data type that lets us access many variables of the same type through a single identifier. Consider the

More information

NOTE: Answer ANY FOUR of the following 6 sections:

NOTE: Answer ANY FOUR of the following 6 sections: A-PDF MERGER DEMO Philadelphia University Lecturer: Dr. Nadia Y. Yousif Coordinator: Dr. Nadia Y. Yousif Internal Examiner: Dr. Raad Fadhel Examination Paper... Programming Languages Paradigms (750321)

More information

Special Topics: Programming Languages

Special Topics: Programming Languages Lecture #23 0 V22.0490.001 Special Topics: Programming Languages B. Mishra New York University. Lecture # 23 Lecture #23 1 Slide 1 Java: History Spring 1990 April 1991: Naughton, Gosling and Sheridan (

More information

Object Oriented Programming

Object Oriented Programming Binnur Kurt kurt@ce.itu.edu.tr Istanbul Technical University Computer Engineering Department 1 Version 0.1.2 About the Lecturer BSc İTÜ, Computer Engineering Department, 1995 MSc İTÜ, Computer Engineering

More information

Sri Vidya College of Engineering & Technology

Sri Vidya College of Engineering & Technology UNIT I INTRODUCTION TO OOP AND FUNDAMENTALS OF JAVA 1. Define OOP. Part A Object-Oriented Programming (OOP) is a methodology or paradigm to design a program using classes and objects. It simplifies the

More information

Real-Time and Embedded Systems (M) Lecture 19

Real-Time and Embedded Systems (M) Lecture 19 Low-Level/Embedded Programming Real-Time and Embedded Systems (M) Lecture 19 Lecture Outline Hardware developments Implications on system design Low-level programming Automatic memory management Timing

More information

Advanced Programming & C++ Language

Advanced Programming & C++ Language Advanced Programming & C++ Language ~6~ Introduction to Memory Management Ariel University 2018 Dr. Miri (Kopel) Ben-Nissan Stack & Heap 2 The memory a program uses is typically divided into four different

More information

Chapter 17 vector and Free Store. Bjarne Stroustrup

Chapter 17 vector and Free Store. Bjarne Stroustrup Chapter 17 vector and Free Store Bjarne Stroustrup www.stroustrup.com/programming Overview Vector revisited How are they implemented? Pointers and free store Allocation (new) Access Arrays and subscripting:

More information

Unit 1: Visual Basic.NET and the.net Framework

Unit 1: Visual Basic.NET and the.net Framework 1 Chapter1: Visual Basic.NET and the.net Framework Unit 1: Visual Basic.NET and the.net Framework Contents Introduction to.net framework Features Common Language Runtime (CLR) Framework Class Library(FCL)

More information

Undefined Behaviour in C

Undefined Behaviour in C Undefined Behaviour in C Report Field of work: Scientific Computing Field: Computer Science Faculty for Mathematics, Computer Science and Natural Sciences University of Hamburg Presented by: Dennis Sobczak

More information

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1)

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1) Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 2 Professional Program: Data Administration and Management JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1) AGENDA

More information

Inheritance: Develop solutions by abstracting real-world object and their interaction into code to develop software solutions. Layering: Organization

Inheritance: Develop solutions by abstracting real-world object and their interaction into code to develop software solutions. Layering: Organization Final Exam Overview: Monday, 3pm-6pm, in WLH 2005 First pages: Quiz question - No quiz of week 2 - No bit manipulation (shifting and masking) - Quizzes: week 4, 6, 8, 10 One page on C++ language features

More information

High Performance Computing MPI and C-Language Seminars 2009

High Performance Computing MPI and C-Language Seminars 2009 High Performance Computing - Seminar Plan Welcome to the High Performance Computing seminars for 2009. Aims: Introduce the C Programming Language. Basic coverage of C and programming techniques needed

More information

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE PART A UNIT I 1. Differentiate object oriented programming from procedure oriented programming. 2. Define abstraction and encapsulation. 3. Differentiate

More information

CSCI-GA Scripting Languages

CSCI-GA Scripting Languages CSCI-GA.3033.003 Scripting Languages 12/02/2013 OCaml 1 Acknowledgement The material on these slides is based on notes provided by Dexter Kozen. 2 About OCaml A functional programming language All computation

More information

Object-Oriented Programming for Scientific Computing

Object-Oriented Programming for Scientific Computing Object-Oriented Programming for Scientific Computing Dynamic Memory Management Ole Klein Interdisciplinary Center for Scientific Computing Heidelberg University ole.klein@iwr.uni-heidelberg.de 2. Mai 2017

More information

CS 430 Spring Mike Lam, Professor. Data Types and Type Checking

CS 430 Spring Mike Lam, Professor. Data Types and Type Checking CS 430 Spring 2015 Mike Lam, Professor Data Types and Type Checking Type Systems Type system Rules about valid types, type compatibility, and how data values can be used Benefits of a robust type system

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

How to Break Software by James Whittaker

How to Break Software by James Whittaker How to Break Software by James Whittaker CS 470 Practical Guide to Testing Consider the system as a whole and their interactions File System, Operating System API Application Under Test UI Human invokes

More information

A brief introduction to C programming for Java programmers

A brief introduction to C programming for Java programmers A brief introduction to C programming for Java programmers Sven Gestegård Robertz September 2017 There are many similarities between Java and C. The syntax in Java is basically

More information

Lectures 5-6: Introduction to C

Lectures 5-6: Introduction to C Lectures 5-6: Introduction to C Motivation: C is both a high and a low-level language Very useful for systems programming Faster than Java This intro assumes knowledge of Java Focus is on differences Most

More information

Lab 03 - x86-64: atoi

Lab 03 - x86-64: atoi CSCI0330 Intro Computer Systems Doeppner Lab 03 - x86-64: atoi Due: October 1, 2017 at 4pm 1 Introduction 1 2 Assignment 1 2.1 Algorithm 2 3 Assembling and Testing 3 3.1 A Text Editor, Makefile, and gdb

More information

The PCAT Programming Language Reference Manual

The PCAT Programming Language Reference Manual The PCAT Programming Language Reference Manual Andrew Tolmach and Jingke Li Dept. of Computer Science Portland State University September 27, 1995 (revised October 15, 2002) 1 Introduction The PCAT language

More information

Pointers and Memory 1

Pointers and Memory 1 Pointers and Memory 1 Pointer values Pointer values are memory addresses Think of them as a kind of integer values The first byte of memory is 0, the next 1, and so on A pointer p can hold the address

More information

Computer Components. Software{ User Programs. Operating System. Hardware

Computer Components. Software{ User Programs. Operating System. Hardware Computer Components Software{ User Programs Operating System Hardware What are Programs? Programs provide instructions for computers Similar to giving directions to a person who is trying to get from point

More information

Programming. Loriano Storchi.

Programming. Loriano Storchi. Programming Loriano Storchi loriano@storchi.org http:://www.storchi.org/ Algorithms Algorithms describe the way in which information is transformed. Informatics takes care of their theory, analysis, planning,

More information

BCS THE CHARTERED INSTITUTE FOR IT. BCS Higher Education Qualifications BCS Level 6 Professional Graduate Diploma in IT EXAMINERS' REPORT

BCS THE CHARTERED INSTITUTE FOR IT. BCS Higher Education Qualifications BCS Level 6 Professional Graduate Diploma in IT EXAMINERS' REPORT BCS THE CHARTERED INSTITUTE FOR IT BCS Higher Education Qualifications BCS Level 6 Professional Graduate Diploma in IT March 2017 EXAMINERS' REPORT Programming Paradigms General comments on candidates'

More information

ITP 342 Advanced Mobile App Dev. Memory

ITP 342 Advanced Mobile App Dev. Memory ITP 342 Advanced Mobile App Dev Memory Memory Management Objective-C provides two methods of application memory management. 1. In the method described in this guide, referred to as manual retain-release

More information

CS558 Programming Languages

CS558 Programming Languages CS558 Programming Languages Fall 2016 Lecture 3a Andrew Tolmach Portland State University 1994-2016 Formal Semantics Goal: rigorous and unambiguous definition in terms of a wellunderstood formalism (e.g.

More information

3. Java - Language Constructs I

3. Java - Language Constructs I Educational Objectives 3. Java - Language Constructs I Names and Identifiers, Variables, Assignments, Constants, Datatypes, Operations, Evaluation of Expressions, Type Conversions You know the basic blocks

More information

COMPILER DESIGN. For COMPUTER SCIENCE

COMPILER DESIGN. For COMPUTER SCIENCE COMPILER DESIGN For COMPUTER SCIENCE . COMPILER DESIGN SYLLABUS Lexical analysis, parsing, syntax-directed translation. Runtime environments. Intermediate code generation. ANALYSIS OF GATE PAPERS Exam

More information

VARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs.

VARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. Lesson 2 VARIABLES Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. WHAT ARE VARIABLES? When you input data (i.e. information) into a computer

More information

New Programming Paradigms

New Programming Paradigms New Programming Paradigms Lecturer: Pánovics János (google the name for further details) Requirements: For signature: classroom work and a 15-minute presentation Exam: written exam (mainly concepts and

More information

White Paper. How the Meltdown and Spectre bugs work and what you can do to prevent a performance plummet. Contents

White Paper. How the Meltdown and Spectre bugs work and what you can do to prevent a performance plummet. Contents White Paper How the Meltdown and Spectre bugs work and what you can do to prevent a performance plummet Programs that do a lot of I/O are likely to be the worst hit by the patches designed to fix the Meltdown

More information

Higher Computing Science Software Design and Development - Programming Summary Notes

Higher Computing Science Software Design and Development - Programming Summary Notes Higher Computing Science Software Design and Development - Programming Summary Notes Design notations A design notation is the method we use to write down our program design. Pseudocode is written using

More information

Review sheet for Final Exam (List of objectives for this course)

Review sheet for Final Exam (List of objectives for this course) Review sheet for Final Exam (List of objectives for this course) Please be sure to see other review sheets for this semester Please be sure to review tests from this semester Week 1 Introduction Chapter

More information

Language Basics. /* The NUMBER GAME - User tries to guess a number between 1 and 10 */ /* Generate a random number between 1 and 10 */

Language Basics. /* The NUMBER GAME - User tries to guess a number between 1 and 10 */ /* Generate a random number between 1 and 10 */ Overview Language Basics This chapter describes the basic elements of Rexx. It discusses the simple components that make up the language. These include script structure, elements of the language, operators,

More information

GO MOCK TEST GO MOCK TEST I

GO MOCK TEST GO MOCK TEST I http://www.tutorialspoint.com GO MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Go. You can download these sample mock tests at your local machine

More information

Chapter 17 vector and Free Store

Chapter 17 vector and Free Store Chapter 17 vector and Free Store Bjarne Stroustrup www.stroustrup.com/programming Overview Vector revisited How are they implemented? Pointers and free store Allocation (new) Access Arrays and subscripting:

More information

Students received individual feedback throughout year on assignments.

Students received individual feedback throughout year on assignments. ACS108 No exam. Students received individual feedback throughout year on assignments. ACS123 In general, during ACS123 exam session, students have shown satisfactory performance, clear understanding of

More information

National 5 Computing Science Software Design & Development

National 5 Computing Science Software Design & Development National 5 Computing Science Software Design & Development 1 Stages of Development 2 Analysis 3 Design 4 Implementation 5 Testing 6 Documentation 7 Evaluation 8 Maintenance 9 Data Types & Structures 10

More information

CS558 Programming Languages

CS558 Programming Languages CS558 Programming Languages Winter 2017 Lecture 4a Andrew Tolmach Portland State University 1994-2017 Semantics and Erroneous Programs Important part of language specification is distinguishing valid from

More information

CSc 520. Principles of Programming Languages 25: Types Introduction

CSc 520. Principles of Programming Languages 25: Types Introduction CSc 520 Principles of Programming Languages 25: Types Introduction Christian Collberg Department of Computer Science University of Arizona collberg@cs.arizona.edu Copyright c 2005 Christian Collberg April

More information

Using Static Code Analysis to Find Bugs Before They Become Failures

Using Static Code Analysis to Find Bugs Before They Become Failures Using Static Code Analysis to Find Bugs Before They Become Failures Presented by Brian Walker Senior Software Engineer, Video Product Line, Tektronix, Inc. Pacific Northwest Software Quality Conference,

More information

Lectures 5-6: Introduction to C

Lectures 5-6: Introduction to C Lectures 5-6: Introduction to C Motivation: C is both a high and a low-level language Very useful for systems programming Faster than Java This intro assumes knowledge of Java Focus is on differences Most

More information

Full file at

Full file at Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class

More information

102. Introduction to Java Programming

102. Introduction to Java Programming 102. Introduction to Java Programming Version 5.0 Java is a popular and powerful language. Although comparatively simple in its language structure, there are a number of subtleties that can trip up less

More information

Storage. Outline. Variables and updating. Copy vs. Ref semantics Lifetime. Dangling References Garbage collection

Storage. Outline. Variables and updating. Copy vs. Ref semantics Lifetime. Dangling References Garbage collection Storage 1 Variables and updating Outline Copy vs. Ref semantics Lifetime Local and global variables Heap variables Persistent variables Dangling References Garbage collection 2 Variables and Updating Variable:

More information

Memory Allocation. Static Allocation. Dynamic Allocation. Dynamic Storage Allocation. CS 414: Operating Systems Spring 2008

Memory Allocation. Static Allocation. Dynamic Allocation. Dynamic Storage Allocation. CS 414: Operating Systems Spring 2008 Dynamic Storage Allocation CS 44: Operating Systems Spring 2 Memory Allocation Static Allocation (fixed in size) Sometimes we create data structures that are fixed and don t need to grow or shrink. Dynamic

More information

Compaq Interview Questions And Answers

Compaq Interview Questions And Answers Part A: Q1. What are the difference between java and C++? Java adopts byte code whereas C++ does not C++ supports destructor whereas java does not support. Multiple inheritance possible in C++ but not

More information