Smalltalk Interview Questions & Answers

5 avg. rating (100% score) - 1 votes

Smalltalk Interview Questions & Answers

Getting prepared for Smalltalk job? Do not panic, we will guide you how and what to answer in your interview. If you are preparing for Smalltalk job interview then go through Wisdomjobs interview questions and answers page. Smalltalk is a object oriented, reflective progamming language. Unlike C++ , Smalltalk is a pure object-oriented language with more rigorously enforced rules than C++, which permits some of the procedural constructs of the C language. Smalltalk programs are usually compiled to bytecode, which is then interpreted by a virtual machine into machine-native code. There are many openings for this job as this is much popular and used in every field. Please have a look at Smalltalk interview questions and answers page to win your interview.

Smalltalk Interview Questions

Smalltalk Interview Questions
    1. Question 1. What Is Smalltalk?

      Answer :

      Smalltalk is pure object oriented programming (OOPs), dynamically typed and reflective programming language.

      Smalltalk is an improvement environment – class browsers, debugger, inspector and refactoring engine.

      Everything is an object –variables, constants, activation records and classes.

      Smalltalk was designed and created by Learning Research Group of Xerox PARC in 1972 and the Researcher Team –

      • Alan Kay
      • Dan Ingalls
      • Adele Goldberg
      • Ted Kaehler
      • Scott Wallace
      • And so on

      All computation is performed by objects sending and receiving messages – 1+2*3

    2. Question 2. What Types Of Characters Allowable In Smalltalk?

      Answer :

      • 0-9
      • A-Z
      • a-z
      • .+/*~<>@%|&?
      • blank, tab, cr, ff, lf
      • And so on

    3. Question 3. How To Declare Variables In Smalltalk?

      Answer :

      • Variables must be declared before use
      • Shared variables must begin with uppercase
      • Local variables must begin with lowercase
      • Reserved names - true, false, nil, self and super

    4. Question 4. What Is The Variable Scope In Smalltalk?

      Answer :

      • Global
      • Class
      • Class Instance
      • Pool
      • Block Temporary
      • Method Temporary
      • Method Parameters
      • Instance Variables

    5. Question 5. What Is "the Smalltalk For Those Who Can Type" Supposed To Mean?

      Answer :

      It is a pun on the usage of a text editor (and thus using the keyboard more, and the mouse less) to write programs for GNU Smalltalk, which sets it different from other Smalltalk.

    6. Question 6. How Stable Is Gnu Smalltalk? How Scalable? How Fast?

      Answer :

      It is quite stable. There are bugs for sure in the virtual machine, but unless you're unlucky you shouldn't be affected. This is especially true for the stable branch, where only changes to improve stability are made; development releases are by their very nature less stable.

      It is quite scalable, even though the garbage collector performs worse once you have more than 150-200 MB of live data. Very long strings also do not perform as well as they could. In general, object-orientation makes it easier to pick good data structures (such as streams).

      It is quite fast. While GNU Smalltalk has an experimental just-in-time compiler, even the bytecode interpreter should be faster than most other scripting languages. However, GNU Smalltalk's base classes are written entirely in Smalltalk (unlike Python or Lua, for example). While this gives more flexibility to the programmer, programs that heavily use dictionaries may run slower than the equivalent programs in other languages.

    7. Question 7. Where's The Gui?

      Answer :

      GNU Smalltalk does not by default start a full-blown integrated development environment.

      However, one is available and can be started with this command:

      gst-blox

      The latest git versions include a new IDE, called VisualGST,

      that can be started with this command instead:

      gst-browser

    8. Question 8. What Is Cool About Smalltalk?

      Answer :

      Smalltalk is an object-oriented programming language with a uniform programming model. Unlike many other languages, learning the Smalltalk programming language is easy because there are just a few concepts to grasp. Everything is an object in Smalltalk (including number, string, character, code blocks, and classes themselves), and everything is done through a single paradigm, that of sending messages from one object to another.

      Many cool and revolutionary ideas were conceived from the Smalltalk community, including the very idea of window-based, graphical user interfaces. Smalltalk systems are open, as source code for every class is available and modifiable, including all the kernel classes; being free software, GNU Smalltalk extends this openness to the virtual machine, and complements it with the freedom to redistribute and publish your improvements.

    9. Question 9. What Else Is Cool About Gnu Smalltalk?

      Answer :

      First of all, it is free software. This means that you can play with it and understand how it works, break it and understand why it broke, fix it and enjoy having fixed it.

      Compared to other Smalltalk implementations, GNU Smalltalk is very different in one aspect: it is pragmatically designed to be a tool rather than an environment. It complements other tools that you use in your daily work, without any pretense of completely replacing them. This also provides a smoother learning curve for people who know other scripting languages such as Python or Ruby.

    10. Question 10. What Is A Generator?

      Answer :

      A generator is a quick way to create a Stream. As you might have seen in an earlier question, streams are a powerful iteration tool that Smalltalk offers. A generator is a kind of pluggable stream, in that a user-supplied blocks defines which values are in a stream.

      For example, here is an empty generator and two infinite generators:

      Generator on: [ :gen | ]

      Generator on: [ :gen | [ gen yield: 1 ] repeat ]

      Generator inject: 1 into: [ :value | value + 1 ]

      As a more concrete example, these lines process a file and create Person objects out of the file:

      lines := file lines.

      lines := lines select: [ :line | line ~ '^[A-Za-z]+ [0-9]+$' ].

      fields := lines collect: [ :line | line subStrings ].

      people := fields collect: [ :data |

                  Person name: data first age: data second asInteger ].

      Let's see how to rewrite them to use a single Generator instead:

      Generator on: [ :gen |

          file linesDo: [ :line || data |

              line ~ '^[A-Za-z]+ [0-9]+$' ifTrue: [

                  data := line subStrings.

                  gen yield: (Person name: data first age: data second asInteger) ] ] ].

      As you can see, #select: becomes an if-statement, and the value from the final stream is yielded to the user of the generator.

      Generators use continuations, but they shield the users from their complexity by presenting the same simple interface as streams.

    11. Question 11. What Is Vfs?

      Answer :

      VFS is GNU Smalltalk's Virtual FileSystem layer. VFS allows GNU Smalltalk programs to use archive files (.gz, .tar, .zip, etc.) and URLs transparently. The first implementation of VFS was inspired by the homonymous feature of the Midnight Commander, later incorporated in GNOME and now called GVFS.

      VFS is a fundamental part of the implementation of .star packages.

    12. Question 12. Does Gnu Smalltalk Support Unicode And Mbcs?

      Answer :

      Yes. Strings however are processed (e.g. read from a file) byte-per-byte. If you need per-character processing, you should load the Iconv package and convert strings to UnicodeString, using the #asUnicodeString method.

Popular Interview Questions

All Interview Questions

Smalltalk Practice Test

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Tutorial