Javatpoint Logo
Javatpoint Logo

Pascal Interview Questions

Pascal Interview Questions

There is given Pascal interview questions and answers that has been asked in many companies. Let's see the list of top Pascal interview questions.

1) Explain Pascal.

Pascal is an imperative and procedural programming language. It was developed in 1970 by Niklaus Wirth. It follows the basics of structured programming and data structuring.

2) Why Pascal is named as Pascal?

The name Pascal was given in honor of the French mathematician, philosopher and physicist Blaise Pascal.

3) Who was the developer of Pascal language?

Pascal is designed by Niklaus Wirth.

4) Which was the most influential language in Pascal development?

Pascal was mainly influenced by ALGOL W language.

5) Which languages are influenced by Pascal most?

Pascal influenced the following languages:

Ada, Component Pascal, Go, Java, Modula, Oberon etc.

6) What are some distinguish features of Pascal?

Following are some specific features of Pascal:

  • Structured programming language that uses control structures like if-else, repeat-until statement.
  • Provide simplicity and modular approach for machine implementation.
  • Having different data structures that are included with the records, arrays, files, pointers, etc.
  • Offer extensive error checking.
  • Support object oriented programming.

7) Why is it named Pascal?

It is named in the honor of a great French mathematician and philosopher Blaise Pascal.

8) How do you describe a Pascal set?

A collection of same type of elements is called a set. The elements in the set are called members. In Pascal, elements are enclosed in square bracket [].

9) What is a datatype? What are the different data types included in Pascal?

A datatype specifies a range of values that a variable can store. It also includes the set of operations that are performed on different datatypes.

Following are the different datatypes in Pascal:

  • Scalar
  • Pointer
  • Structured

Image: Pascal-datatype

Pascal datatype

10) What is pointer in Pascal?

In Pascal, a pointer is a dynamic variable which specifies the value of another variable. You must declare a pointer before you use it to store any variable address.

11) What are different Pointer concepts in Pascal programming?

Following is a list of some important pointer concepts used in Pascal programming:

  • Arithmetic pointers: It specifies four arithmetic operators that can be used on pointers i.e. increment, decrement, +, -
  • Array of Pointers: An array can be defined to hold a number of pointers.
  • Pointer to pointer: Pascal facilitates you to use pointer on a pointer and so on.
  • Return a subprograms in Pascal: Pascal facilitates a subprogram to return a pointer.

12) What is IP Pascal?

IP Pascal stands for Interplatform Pascal. It supports the following platform in its current configuration:

  • Windows /95/98/ME/NT/2000/XP.
  • Linux/86.

13) What is unit in Pascal?

Modules of Pascal programs are referred as units. A module or unit contains some code blocks, which contain variables and type declarations, statement procedures etc. There are many built-in units in Pascal.

14) What is the reason behind using UNITS in Pascal programming?

There are three reasons to use UNITS in programming:

  • Simplicity: It simplifies the use of same code in some other programs to do the same job.
  • Easy to handle: It makes handling easy because some large programs are split into smaller section.
  • Easy to call: Putting codes in UNIT, makes it easy to call and use it again.

15) What are the different Pascal standards?

The first Pascal standard was documented by the author of the Pascal programming language Niklaus Wirth but it was an unofficial Pascal standard.

The first official standard was ISO 7185 issued in 1983. It was followed by the extended standard ISO 10206 in 1990. Another standard Object-Oriented Extension to Pascal was introduced but never completed due to lack of interest.

16) What is constant in Pascal? What constants are declared in Pascal?

An entity which doesn't change is called constant. It remains unchanged during program execution. Following constants are declared in Pascal:

  • Ordinal types
  • Set types
  • Pointer types (Only nil value is allowed).
  • Real types
  • Char
  • String

17) Write syntax to declare constants in Pascal.


18) What are the REPORT methods for which the portability is given in Pascal?

There are two REPORT methods for portability:

Application: It contains a guideline which facilitates you to use implementation and features according to the compiler, to make the application more portable.

Compiler: It is used to implement the language that is likely to implement the features like determining of the types compatible with one another.

19) How can you define a string in Pascal?

A string can be defined in many ways:

  • As a string variables
  • As a short strings
  • As a character arrays
  • As a null terminated strings
  • As a ansiStrings

20) What is the control structure used in Pascal?

  • Pascal uses structure programming language to display the flow of control in a structured manner.
  • Pascal uses the goto statement as a standard statement that allows the control to be given to the main program in a recursive manner.
  • Pascal provides more easy way to represent them without using the semicolon to end the statements written in one line.
  • Pascal uses loops as a control structure to represent the statements and uses assignment operators to assign the values to the variables.

21) What is the usage of Extension in Pascal?

Extension makes the program more clean and portable to use by providing the interfaces to be used in programs.

22) Is Pascal designed to be a teaching language?


Why Pascal is called teaching language?

It is often said that Pascal is a toy language and not to built for real-world programming. Check, what the father of Python Niklaus Wirth said:

"Occasionally, it has been claimed that Pascal was designed as a language for teaching. Although it is correct, its use in teaching was not the only goal. In fact, I don't believe in using tools and formalisms in teaching that are inadequate for any practical task." - Niklaus Wirth from the 1984 ACM A.M. Turing award lecture

23) What is the difference between apple Pascal and UCSD Pascal?

  • UCSD Pascal: UCSD Pascal is a Pascal programming language system, run on UCSD p-system a portable, highlymachine-independent operating system.
  • Apple Pascal:Apple Pascal is a language and operating system based on the UCSD Pascal system.

24) What is the difference between Turbo and Standard Pascal?

  • The Turbo Pascal uses dynamic variables and pointers to show the standard procedures like new, mark and release. Whereas, standard Pascal doesn't use dynamic variables and uses procedures like new and dispose.
  • Turbo Pascal is more efficient, faster and doesn't require the support code that offers the compatibility factor. Whereas, Standard Pascal doesn't, accept the record specifications for their standard procedures.
  • Turbo Pascal is using the local variables that are handled in the recursion phase and it also passes the recursive calls to others. Whereas, Standard Pascal doesn't, make use of recursion for their subprograms.
  • Turbo Pascal doesn't use the Get and Put methods but instead of that there is a use of Read and write procedures that extend the functionality of the I/O methods. Whereas, it supports the use of get and put methods.
  • Turbo Pascal doesn't implement the standard page procedure as the operating system doesn't define the form-feed character.

25) What is the difference between Modern Pascal and Standard Pascal?

  • Standard Pascal is less secure and more ambiguous while programming or coding. Whereas, Modern Pascal provides more securities and fewer ambiguities while programming or coding.
  • Modern Pascal provides backward compatibility by the use of functions and procedures with their parameters. Whereas, standard Pascal doesn't provide this kind approach and doesn't follow the backward compatibility.
  • Modern Pascal provides Var parameters to be used with the procedures and functions and make advancement over the standard Pascal.
  • Modern Pascal provides the definitive type of compatibility with its parameters and the symbols used. Whereas, standard Pascal doesn't provide anything related to the symbols.
  • Modern Pascal allows the removal of the length of the symbol that is limited. Whereas, standard Pascal doesn't remove the symbol length limit.

26) What are the different insecurities involved in Pascal?

Following are the main insecurities involved in Pascal:

  • Infinite loop: This is an area that makes the program to run for a longer period of time and it becomes hard to control and terminate it.
  • Insecure variants: the variants used should be able to change the pointer to an integer or vise versa this can create errors when writing big programs.

27) Is there any Freeware Pascal compiler?

Yes. One of the most recent and active freeware Pascal compilers is FPK Pascal. It is a 32 bit Turbo Pascal compatible compiler system for DOS and OS/2.

28) What is the Pascal compiler used on HPCVL machines?

The Pascal compiler installed on the Sun Fire system of HPCVL is the Gnu Pascal Compiler (GPC). It is a public-domain compiler that has a great deal of extensions and compatibility features built within it. It is portable.

You may also like:

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA