Are you a candidate looking to sharpen your skills? Try our practice tests or view sample interview questions & Get hired by the best. Click Here×

Delphi Test Assessment

Topics Covered

  • Constructors
  • Delphi Data Acquisitions
  • Delphi I/O Port Programming
  • Delphi COM References
  • Delphi Database Notes

Useful for hiring

  • Delphi Developer

Start hiring job-fit candidates using this assessment

GET A DEMO

"We realized that to acquire quality talent, our recruitment process was in dire need of automation. Too many of our technicalteam were simply wasting hours conducting interviews that did not yield the desired results. For us the foremost criteria were to finda recruitment partner who could tick all the right boxes"

Rehana Nisar, Gartner,
Global Product & Services Recruitment Head
Question

Suppose, there is the next class hierarchy:

  TAncestor = class
     ...
     procedure SomeMethod; virtual;
     ...
  end;
  TInheritor = class (TAncestor)
    ...
     procedure SomeMethod; {directive}
    ... 
  end;

Specify the problems for these lines of code.
var
    Inheritor: TInheritor;
    Ancestor: TAncestor;
begin
    Inheritor := TInheritor(TAncestor.Create); {a}
    Inheritor.SomeMethod(); {b}
    Inheritor.Free;    
    
    Ancestor := TAncestor(TInheritor.Create); {c}
    Ancestor.SomeMethod(); {d}
    Ancestor.Free;
end;

Answer
    • line {a} will raise exception at runtime

    • line {b} will raise exception at runtime if TInheritor.SomeMethod marked as virtual

    • line {c} will raise exception at runtime

    • line {d} will raise an exception at runtime if TInheritor.SomeMethod marked as override

    • line {d} will raise an exception at runtime if TInheritor.SomeMethod marked as virtual

Question

Suppose, we have interface declaration, and classes declared as:

  ISomeInterface = interface(IInterface)
      ['{F4FAEE2B-FA98-4240-84FF-647725844C8F}']
      procedure SomeActivity;
  end;
  TImplementator = class(TInterfacedObject, ISomeInterface)
    procedure SomeActivity;
  end;

  TMaster = class
      private
        Obj: TImplementator;
      public
        constructor Create;
        function GetInterfacedObj: ISomeInterface;
  end;

with the follow implementation of TMaster:

constructor TMaster.Create;
begin
    Self.Obj := TImplementator.Create;
end;
function TMaster.GetInterfacedObj: ISomeInterface;
begin
    RESULT := Self.Obj;
end;

Which letters will contain the result of the Test() function call?

function Test: string;
    var Objt: TImplementator;
        Obji: ISomeInterface;
        Master: TMaster;
        ch: char;
        log: string;

    procedure Activity(Master: TMaster);
    begin
        Master.GetInterfacedObj.SomeActivity();
    end;
    
    begin
        log := '';
        try
            Master := TMaster.Create;
            try
                for ch := 'a' to 'b' do
                try
                    Activity(Master);
                except on E: Exception do
                    log := log + ch;
                end;
                try
                    
                except on E: Exception do
                    ShowMessage('');
                end;
            finally
                Master.Free;
            end;


            Objt := TImplementator.Create;
            try
                for ch := 'c' to 'd' do
                try
                    Obji := Objt;
                    Obji.SomeActivity();
                except on E: Exception do
                    log := log + ch;
                end;
            finally
                Objt.Free;
            end;
        except on E: Exception do
            log := log + 'e';
        end;
        RESULT := log;
end;

Note: There can be multiple correct answers to this question.

Answer
    • a

    • b

    • c

    • d

    • e

Question

There is the class declaration as below:

    TDataContainerClass = Class
        private
            IndexedData: array[0..255] of Integer;
            function GetData(Index: Integer): Integer;
            procedure SetData(Index: Integer; Value: Integer);
        public
            property Data[Index: Integer]: Integer read GetData write SetData; default;
            property Tail: Integer Index 255 read GetData write SetData;
    End;

Also, integer variable val has declared.
    
Select lines of syntactically correct blocks of code, using  DataContainer: TDataContainerClass object.

Note: There can be multiple correct answers to this question.

Answer
    • DataContainer(1) := $FF SHR 1;
      val := DataContainer.Data(0);

    • DataContainer.Tail := DataContainer[0];

    • DataContainer.Data.Tail := DataContainer[0].Data;
      val := DataContainer[0].Data;

    • DataContainer.Data(0) := $FF;

    • DataContainer.Data[0] := $FF;
      val := DataContainer[0];

Test details:

Delphi Test enables employers and recruiters to evaluate skills and job readiness of candidates. For this reason, the emphasis is laid upon evaluating the knowledge of applied skills gained through real work experience, rather than theoretical knowledge.

Test Details: 20 minutes 

20 Application Questions


The combination of Application and Theory questions helps to evaluate Technical as well as practical Skills of Candidates.

Test description:

Delphi test is useful to effectively assess the skills of candidates before an interview. Delphi Test is a programming language and software development for desktop, mobile, web and console applications and it uses Object Pascal which continues to develop as its underlying the object oriented language. It is designed to check the development and application skills. The test is created and validated by Subject Matter Experts. 

The Delphi Test contains questions on following topics:  

  • Constructors

  • Delphi Data Acquisitions

  • Delphi I/O Port Programming

  • Delphi COM References

  • Delphi Database Notes

Good News! You can customize this test as per your requirement

  • Choose and add questions from Interview Mocha question libraries

  • Add your own set of questions

  • Customize test settings like duration, number of questions, passing score, web proctoring and much more

  • Mail us at support@interviewmocha.com to create a custom test

Looking for a tailor-made test, to suit your assessment needs?

Get in touch

Global companies using Mocha assessments

  • altran
  • credit suisse
  • sephora
  • nielsen
  • capgemini
  • akamai

How Mocha assessments are brewed

Speed up your IT recruitment with Interview Mocha

  • 500+ IT skill tests
  • 20+ coding languages
  • 50+ domain knowledge tests
  • 100+ digital 2.0 skill tests
  • Customer focus aptitude tests
  • Enterprise ready features & more...
GET A DEMO

Why hiring managers and recruiters across the globe love Interview Mocha

Take your first step to hire job fit candidates

GET A DEMO