Results 1 to 29 of 29

Thread: Interview Questions

  1. #1

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    Interview Questions

    This may have been posted before but thought it was quite interesting,

    here's a few questions qhich are apparently quite common. feel free to answer any.

    3 main differences between flexgrid control and dbgrid control
    ActiveX and Types of ActiveX Components in VB
    Advantage of ActiveX Dll over Active Exe
    Advantages of disconnected recordsets
    Benefit of wrapping database calls into MTS transactions
    Benefits of using MTS
    Can database schema be changed with DAO, RDO or ADO?
    Can you create a tabletype of recordset in Jet - connected ODBC database engine?
    Constructors and distructors
    Controls which do not have events
    Default property of datacontrol
    Define the scope of Public, Private, Friend procedures?
    Describe Database Connection pooling relative to MTS
    Describe: In of Process vs. Out of Process component. Which is faster?
    Difference between a function and a subroutine, Dynaset and Snapshot,early and late binding, image and picture controls,Linked Object and Embedded Object,listbox and combo box,Listindex and Tab index,modal and moduless window, Object and Class,Query unload and unload in form, Declaration and Instantiation an object?
    Draw and explain Sequence Modal of DAO
    How can objects on different threads communicate with one another?
    How can you force new objects to be created on new threads?
    How does a DCOM component know where to instantiate itself?
    How to register a component?
    How to set a shortcut key for label?
    Kind of components can be used as DCOM servers
    Name of the control used to call a windows application
    Name the four different cursor and locking types in ADO and describe them briefly
    Need of zorder method, no of controls in form, Property used to add a menus at runtime, Property used to count number of items in a combobox,resize a label control according to your caption.
    Return value of callback function, The need of tabindex property
    Thread pool and management of threads within a thread pool
    To set the command button for ESC, Which property needs to be changed?
    Type Library and what is it's purpose?
    Types of system controls, container objects, combo box
    Under the ADO Command Object, what collection is responsible for input to stored procedures?
    VB and Object Oriented Programming
    What are the ADO objects? Explain them.
    What are the different compatibility types when we create a COM component?
    What do ByVal and ByRef mean and which is the default?
    What does Option Explicit refer to?
    What does the Implements statement do?
    What is OLE and DDE? Explain.
    What is the difference between Msgbox Statement and MsgboxQ function?
    What keyword is associated with raising system level events in VB?
    What methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful?
    What types of data access have you used.
    What was introduced to Visual Basic to allow the use of Callback Functions?
    Which controls can not be placed in MDI?
    Which controls have refresh method, clear method
    Which Property is used to compress a image in image control?
    Which property of menu cannot be set at run time?
    Which property of textbox cannot be changed at runtime and What's the maximum size of a textbox?
    Which tool is used to configure the port range and protocols for DCOM communications?

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    I "think" I know the correct answer to *some* of them. Why don't you provide the answers to *all* of them?

  3. #3
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Anybody?

    I'm pretty sure that not too many of us know them *ALL*, so I thought that if we had the correct answer, it would give us something to investigate. I'm sure that nobody will try to use it as a cheat sheet in an interview
    Last edited by dglienna; Aug 20th, 2004 at 12:09 AM.

  4. #4
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    a couple of answers

    Advantage of ActiveX Dll over Active Exe


    I don't suppose that this is entirely true. Most of the projects I have worked on used an ActiveX Dll however that doesn't mean that an ActiveX Exe doesn't have its uses.

    one works with the application and the other works outside the applications. Simply put the activeX Dll will crash when the application crashes and vice-versa, but the activeX Exe will be independent.

    Advantages of disconnected recordsets.

    1) sales person carrying laptops can take orders save them to disconnected recordsets which can update the database as and when they get an connection. this is the most common example.

    Can database schema be changed with DAO, RDO or ADO?

    This would depend on the kind of database that you have. Generally speaking its possible to create tables using either of these object models.

    Constructors and destructors

    Not exactly the kind of question that would be asked for a vb programmer. But if you are in .NEt, then it would just be the question to be asked. Code that fires the initialization sequence in a class is the constructor. code that fires the termination sequence is the destructor.

    How to register a component?
    Regsvr32 for ActiveX DLL
    myexe / register for activeX exe

    Thats all for now. More answers later.

    Cheers,
    Abhijit
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    thanks. I will compile them as they come along. I'm sure it would be better to memorize them for an interview instead of having to think about them, and possibly think incorrect answers...

  6. #6
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: a couple of answers

    Originally posted by abhijit
    [B]
    Advantages of disconnected recordsets.

    1) sales person carrying laptops can take orders save them to disconnected recordsets which can update the database as and when they get an connection. this is the most common example.
    Actually thats not what Disconnected Recordset is! Discoonnected RS was introduced in ADO 2.0. The purpose of Disconnected RS is to reduce the need to have a live connection between client application and the database for longer then neccessary. Using disconnected recordset first a connection to the DB is made then result are stored in a recordset and then closed the connection rather then keeping the connection alive. A best example of disconnected recordset is .Net's DataSet object.


    I will try to answer all the other question when i get time ...
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  7. #7
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228
    Oops you are right. I was talking about persistent recordsets. The ones that stay after you have shut-down the application.



    You are absolutely correct about the disconnected recordsets.
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  8. #8
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228
    Describe: In of Process vs. Out of Process component. Which is faster?
    In-Process is always faster. The reason is it runs in the same thread as the process. Inprocess would be an ActiveX OCX or an ActiveX DLL. Out-process would be an Active X Exe.

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    In process is faster also because there is no Cross Process
    Marshalling required since it on the same thread. Whereas out of
    process needs to "translate" in order to communicate between
    threads - more overhead.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  10. #10
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    Here's another one that should go in there...

    "What settings/ or property need to set while using locktype adLockBatchOptimistic?" Plz explain me the answer for the same

    The UpdateBatch method is valid only when the LockType property is specified with adLockBatchOptimistic and the cursor type is either keyset-driven or static. The keyset-driven cursor can be supported only with tables that have unique indexes.
    answered by Frans C

  11. #11
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    Please post the question that you are replying to so that it will be more accurate when they are finally all answered.

    thanks.

  12. #12
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Originally posted by dglienna
    Please post the question that you are replying to so that it will be more accurate when they are finally all answered.

    thanks.
    Dont be lazy, Google it .

    Hope you dont mind, me using your trade marked smile

    PS : I started answering all question then got bored
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  13. #13
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    I have come up with a few of my own, but thought that there should be a 'standard' so they we don't get stumped by trick questions.

  14. #14
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    google is not much help. for example I typed
    vb 'Controls which do not have events'
    and found links to ActiveX controls with events.
    They don't really answer questions phrased in English well

  15. #15
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    any more?

  16. #16
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Originally posted by dglienna
    vb 'Controls which do not have events'
    I can think of the following, i am sure there are more but thats all i can come up with now

    line
    shape
    common dialoge box
    image list
    I will post some more once i get a some to sit down and answer them. If you already know the answer then let me know I will try to answer the ones you dont know or could find answers.

    Hope this helps.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  17. #17
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Advantages of disconnected recordsets
    Discoonnected RS was introduced in ADO 2.0. The purpose of Disconnected RS is to reduce the need to have a live connection between client application and the database for longer then neccessary. Using disconnected recordset first a connection to the DB is made then result are stored in a recordset and then closed the connection rather then keeping the connection alive. A best example of disconnected recordset is .Net's DataSet object.

    Can database schema be changed with DAO, RDO or ADO?
    Usually database schema is changed using ADO extension (ADOX). Database schema can be changed using DAO.

    I haven’t used RDO much so not sure RDO can be used to change schema or not.

    Database engine?
    A programme which performs the database management functions on data held in a database. That is to say it can manipulate, add, delete, search, select and store data following simple user commands.
    www.pads.ahds.ac.uk:81/glossary.html

    The central component of a DBMS. Provides access to the repository and the database and coordinates all of the other functional elements of the DBMS (part of the back end).
    www.gtscompanies.com/glosscomp.html


    Constructors and distructors
    Constructor is a special function in a class which gets executed as soon as a class is instantiated. Constructor have the same name as the class so if the class was called :

    Private Class MyClass()

    Then the constructor for MyClass will be : private MyClass()

    Constructor is used to initialise class variables and other initialisation.

    Destructor is another special function which is similar to constructor but a destructor is automatically called/executed when a class is terminated. Destructor is usually used to perform cleaning up operation when a class terminates, e.g Releasing memory by destroying object/variable and their references. It can also be used to save application settings and so on.


    Controls which do not have events
    Line
    Shape
    Common Dialogue Box
    ImageList

    Default property of datacontrol
    Caption is the default property of DataControl.


    Define the scope of Public, Private, Friend procedures?
    The ‘Public’ qualifier makes the procedures visible and accessible by other application that wish to call and use the procedure. The ‘Private’ qualifier means that only members residing on the same class/module/form can access this function, it will not be visible and accessible from other parts of the VB project or any other application. The ‘Friend’ qualifier in effect defines the function as public to for the entire project, but not to any external application or project. Note that private, public and friend can apply to classes, variable and property as well as function.

    Describe: In of Process vs. Out of Process component. Which is faster?
    In-process Active components are usually DLLs whereas out-of-process are ActiveX EXEs. There is also major difference on how they are loaded into memory. In-process ActiveX is loaded into the Client (the application that is using the DLL) memory. So if the DLL fails/crashes then it will cause the client application to crash too. On the other hand out-of-process ActiveX component are loaded into the memory as a separate thread and does not cause the client application to fail if the components crashes. There is also another different between these tow, in-process ActiveX loads faster then out-of-process ActiveX.

    How to register a component?
    RegSvr32

    How to set a shortcut key for label?
    Use the & before the character you want to make the shortcut key

    Name the four different cursor and locking types in ADO and describe them briefly
    http://mysql.scarlet.be/tech-resourc...and-locks.html

    http://msdn.microsoft.com/library/de...ml/ima0501.asp

    Need of zorder method
    To bring a control to the top of all other controls

    No of controls in form
    Me.Count

    Property used to add a menus at runtime
    PopUpMenu?

    Property used to count number of items in a combobox
    ListCount

    Resize a label control according to your caption.
    Set the AutoSize Property to True


    VB and Object Oriented Programming

    What do ByVal and ByRef mean and which is the default?
    ByVal and ByRef refers to the way object and variable are passed between function. When object/variable are passed by Value then a copy of the passed variable is created and the original value remains unchanged. Where as when ByRef (By Reference) is used the passing variable/object is directly modified so any change in the variable made by the calling function will reflect in the original variable. In VB byVal is the defult.


    What does Option Explicit refer to?
    In VB variable are not required to be declared before they can be used. Option Explicit statement can be used to force the declaration of all variables. When option explicit is used all variable must be declared or an error will be generated by VB Compiler.


    What does the Implements statement do?
    The Implements keyword is for implementing an ‘Interface’ in VB6. Though it is mainly used to simulate Inheritance in VB6.

    What is the difference between Msgbox Statement and MsgboxQ function?
    MsgBox is a built in VB function which displays a Message Box dialoge box. On the other hand MsgBoxQ is a function defined by the user.

    What keyword is associated with raising system level events in VB?
    Raise Event

    Which controls can not be placed in MDI?
    Only control (Standard) that is allowed to be placed is Picture Control in a MDI form.


    Which controls have refresh method, clear method
    Refresh : Almost all controls(Standard VB6) have refresh method apart from Timer control.
    The ListBox and ComboBox control have Clear Method.

    Which property of menu cannot be set at run time?
    Name


    Which property of textbox cannot be changed at runtime and What's the maximum size of a textbox?
    Name property can not be changed at runtime.
    MaxLength of a TextBox is 65535 characters
    Last edited by Danial; Nov 17th, 2004 at 09:00 PM.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  18. #18
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    I wish that I had access to the first post. Maybe I'l copy the answers into a new thread, that lets everyone see which questions have yet to be answered.

  19. #19
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Originally posted by dglienna
    I wish that I had access to the first post. Maybe I'l copy the answers into a new thread, that lets everyone see which questions have yet to be answered.
    From now on when i answer more questions i will edit my previous post.

    Below is another sets of question and answer which i was asked to complete before going to an interview. I am posting it in two parts as the char limit wont allow me to post it in one post.

    Hope this helps.

    Danial
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  20. #20
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    General


    1. Name the three elements of Object Orientation and give a brief description of each.


    The following are three elements of OO :
    Inheritance: Inheritance is fundamental part of OO concept. Inheritance enables the create of a new class which can contain all the functionality (function, properties) of another class.

    Encapsulation: Encapsulation is a technique frequently used in OO. It is the process of hiding details and inner working of object and only exposing the certain methods/properties. The idea behind Encapsulation is that all the inner working of a object is not needed to be known to the outside world, only the necessary methods are exposed which are needed to use the functionality provided by the object.

    Polymorphism: Polymorphism is the ability of Inherited Sub Classes to override the functions of parent class. This allows to implement functionality where same function in different class can perform different task or carry out additional tasks.



    2. What do the acronyms RAM, CPU and CD-ROM stand for ?

    • RAM stands for Random Access Memory
    • CPU stands for Central Processing Unit
    • CD-ROM stands for Compact Disc Read Only Memory


    3. What is the difference between ‘Intranet’ and ‘Internet’?


    ‘Intranet’ is a private network which can only be accessible to authorised user where as ‘Internet’ is public and can be accessed by any one. Intranet enables companies to share information, run web based application which are only accessible to authorised user such as employees and managers.



    4. What is an IP Address?

    IP stands for Internet Protocol and this protocol needs IP address to communicate between computers. IP address is used to identify a Computer on the Internet or in a network uniquely. IP address contains four parts separated by dots, each part contains a numeric number ranging for 0-255. IP is just more then an numeric number. IP address itself contains various information and each part of the IP address reveal certain information(e.g. Host Portion, Network Portion). IP addresses are also divided into 5 classes (A, B, C, D, E), the classes are like a range and different class of IP address is used for different purpose such as Internal Network, Internet and Loop back address. IP address that are used on the Internet need to be registered/assigned to make sure they are unique. Organisation such as InterNIC deals with IP registration for the Internet.



    5. What is meant by the term ‘Data Caching’ and give an example of when you might use it.


    ‘Data Caching’ is a technique used to enhance the performance considerably. The technique involves storing frequently used data in a special part of the Computer from where the data can be accessed much faster and more efficiently then normal. “Data Caching” is used in various areas, it is mainly used to make Database access much faster and efficient. Instead of making queries to a remote database each time, data/rows can be cached locally and queries can be performed locally for faster and efficient access.


    6. What is a pointer?

    A pointer in programming terms means, an address of memory location which can be used to access the content of that memory location e.g. object/data. A pointer can be also stored in a variable and can be used to perform pointer arithmetic. Pointers are commonly used the C++ and can be easily identified as the proceeds the * before the variable name.


    7. What is a variable?

    Variable is used in Programming languages to specify a storage location of data in the memory by name. Variable can store any type of data such as string, integers or even objects. The content of the variable can be changed at any times during the course of a program execution.


    8. What is a constant?

    Constant are a type of variable but the difference is that the content of a constant can not be changed once it has been assigned. The value of a constant is defined before the compilation and can not be changed after compilation.


    9. What is the difference between a method and a property?

    A method is usually used to execute certain sets of instruction sets where as a Property are attributes of a component/objects etc. Attributes such as size, colour and other characteristics are defined using properties. Properties can be can be changed or only read depending on how they are implemented. Properties can implement method to perform validation and other tasks.


    10. What does API stand for?

    API stands for Application Program Interface. APIs are sets of functions exposed be an application which can be used to access various functionally of that application. They are sort of Public Functions in a Class. Operating System like windows exposes APIs and are documented which can be used by programmer to perform various tasks.


    11. What is the difference between a Function and a Procedure?

    Function and Procedure are very similar only function can return a value whereas Procedures don’t.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  21. #21
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    VB
    1. Describe the GET, SET and LET methods

    GET and LET are commonly used in VB when implementing Properties. GET is used to return the value of a property and LET is used to assign the value of a property.

    SET methods is used to assign or instantiate a Class or an Object. Usually NEW key word is combined with SET method to create the instance.
    e.g.

    Dim obj as MyClass ‘define the variable
    Set obj = New MyClass ‘assign/instanciate the MyClass to obj variable


    2. Name 4 data types

    String, Integer, Double

    3. Describe the ‘collection’ object

    Collection object is a type of variable which can be used to store any type of data. It is variable length data type which can be grow and reduce during the program execution. Elements can be added or removed at any time without effecting the other elements. Elements are accessed through the Index which starts with 0.

    4. What are the four standard collection methods?

    The four standard methods of the Collection objects are :
    • Add
    • Remove
    • Count
    • Item

    5. “Implements” is a key word in VB6. What does it offer?

    The Implements keyword is for implementing an ‘Interface’ in VB6. Though it is mainly used to simulate Inheritance in VB6.

    6. “Public Function X()”. Define the scope of this function. Name two other ‘qualifiers’ and their scope.

    The ‘Public’ qualifier makes the function X() public which means that this function is visible and can be accessed from any part of a VB project, or any other application (where this function is in a ActiveX dll). The other two ‘qualifiers’ that are available in VB are Private and Friend. The ‘Private’ qualifier means that only members residing on the same class/module/form can access this function, it will not be visible and accessible from other parts of the VB project or any other application. The ‘Friend’ qualifier in effect defines the function as public to for the entire project, but not to any external application or project. Note that private, public and friend can apply to classes, variable and property as well as function.

    7. What is the difference between an in-process and out-of-process Active-X component?

    In-process Active components are usually DLLs whereas out-of-process are ActiveX EXEs. There is also major difference on how they are loaded into memory. In-process ActiveX is loaded into the Client (the application that is using the DLL) memory. So if the DLL fails/crashes then it will cause the client application to crash too. On the other hand out-of-process ActiveX component are loaded into the memory as a separate thread and does not cause the client application to fail if the components crashes. There is also another different between these tow, in-process ActiveX loads faster then out-of-process ActiveX.

    8. VB6 supports inheritance – True or False

    False. (as it can only simulate inheritance but does not support it fully)

    9. What determines when an object is disposed from memory?

    In VB6 application object are disposed when:
    • Object is out of scope
    • The application is closed
    • Set objectname = Null is used to dispose object
    • Unload keyword is used to dispose object



    10. What is wrong with the following code?

    VB Code:
    1. '* Take a string and replace all ‘A’s with ‘B’
    2.  
    3. Private Function ReplaceAwithB(ByRef sInput As String) As String
    4.     Dim sChar As String
    5.     Dim sCopy As String
    6.     Dim iCount As Integer
    7.    
    8.     sCopy = ""
    9.     iCount = 1
    10.    
    11.     If Len(sInput) > 0 Then
    12.         While iCount <= Len(sInput)
    13.             sChar = Mid(sInput, iCount, 1)
    14.            
    15.             If sChar = "A" Then
    16.                 sChar = "B"
    17.             End If
    18.            
    19.             sCopy = sCopy & sChar
    20.           Wend
    21.     End If
    22.    
    23.  ReplaceAwithB = sCopy
    24. End Function

    The above code creates a endless loop because the content of the variable iCount (the counter used to stop the loop) is never changed so that means then condition While iCount <= Len(sInput) will always remain true and the loop will execute endlessly. To fix this the following line will need to be added before the “Wend” line.
    iCount = iCount + 1

    DB Access / SQL

    1. RDO, ADO, ODBC, DAO and OLE DB - What does each acronym stand for?

    RDO – Remote Data Objects
    ADO – ActiveX Data Objects
    ODBS – Open DataBase Connectivity
    DAO – Data Access Objects
    OLE DB – Object Linking and Embedding DataBase

    2. What is a stored procedure? Why might it be a useful entity?

    Stored procedures are complex SQL queries, which are pre-compiled and stored. This means it runs much faster then standard SQL queries. Stored Procedure allows to execute many sets of SQL statements and then finally return the result as data sets. It is useful as it allows to perform many sets of action in one Stored Procedure. For example, before adding a Row, validation can be preformed to check the data integrity.

    3. What is a trigger?
    A trigger is similar to a stored procedure but a trigger only gets executed when certain action such as Add, Delete or Update is performed. A trigger is usually assigned to a Table so a particular trigger is executed when those action is performed on that specified Table. Triggers are used to perform background task, logging, data update and various other ways.

    4. What are the two security models supported by MS SQL Server?


    • The two security models supported by MS SQL Server are:
    Windows Authentication Mode
    • SQL Server Authentication Mode

    5. Name two ways in which you can get a value returned from a stored procedure.

    • Using ‘Output’ parameter
    • Use Return in the Stored procedure to return value (Also Select statement can be used to return value) and assign the returned value to a Recordset
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  22. #22
    Hyperactive Member
    Join Date
    Mar 2001
    Posts
    485

    Re: Interview Questions

    Quote Originally Posted by Danial
    VB and Object Oriented Programming

    What do ByVal and ByRef mean and which is the default?
    ByVal and ByRef refers to the way object and variable are passed between function. When object/variable are passed by Value then a copy of the passed variable is created and the original value remains unchanged. Where as when ByRef (By Reference) is used the passing variable/object is directly modified so any change in the variable made by the calling function will reflect in the original variable. In VB byVal is the defult.
    FYI,

    VB6, default is ByRef.
    VB.NET default is ByVal.

    BTW, great answers!

  23. #23
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Interview Questions

    1. Describe the GET, SET and LET methods

    GET and LET are commonly used in VB when implementing Properties. GET is used to return the value of a property and LET is used to assign the value of a property.

    SET methods is used to assign or instantiate a Class or an Object. Usually NEW key word is combined with SET method to create the instance.
    e.g.

    Dim obj as MyClass ‘define the variable
    Set obj = New MyClass ‘assign/instanciate the MyClass to obj variable
    In regards to the Set bit, I don't think that's what was intended. A property can be Let/Get or it can be Set/Get. It depends on the data type. For simple data types (non objects) the Let/Get properties are used. The Let is used when assigning a value to the property, while the Get returns the value. Set is used when the data type is an object, and allows the pointer to the object's instance passed through. Set also happens to be used in the assignment of the property.

    2. Name 4 data types

    String, Integer, Double
    one, two, three..... but it says to name 4: Date

    10. What is wrong with the following code?

    VB Code:
    1. '* Take a string and replace all ‘A’s with ‘B’
    2.  
    3. Private Function ReplaceAwithB(ByRef sInput As String) As String
    4. Dim sChar As String
    5. Dim sCopy As String
    6. Dim iCount As Integer
    7.  
    8. sCopy = ""
    9. iCount = 1
    10.  
    11. If Len(sInput) > 0 Then
    12. While iCount <= Len(sInput)
    13. sChar = Mid(sInput, iCount, 1)
    14.  
    15. If sChar = "A" Then
    16. sChar = "B"
    17. End If
    18.  
    19. sCopy = sCopy & sChar
    20. Wend
    21. End If
    22.  
    23. ReplaceAwithB = sCopy
    24. End Function

    The above code creates a endless loop because the content of the variable iCount (the counter used to stop the loop) is never changed so that means then condition While iCount <= Len(sInput) will always remain true and the loop will execute endlessly. To fix this the following line will need to be added before the “Wend” line.
    iCount = iCount + 1
    It's also an example of poor planning and design. Especialy when there's functions built into VB6 that are much more efficient.

    8. What is a constant?

    Constant are a type of variable
    No it isn't. That's a misnomer. It is either a variable, OR a constant. A constant is a mechanism allowing the developer to use a numonic token to represent static information throughout the code. The advantage of this, is that if it does need changing during development, it can be changed in one spot, and the change is represented through out the code where the moniker is used.

    Oh, yeah, and stored procedures are not necessarily precompiled. Depending on the actual DBMS, they may or may not be. In SQL Server 2000, they are no longer compiled, but rather the execution plan from the first run is cached and re-used on subsequant runs. The plan is purged if the SP is dropped and re-created, allowing for a new plan to be cached.



    Tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  24. #24
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Interview Questions

    thanks, guys. we're getting there!

  25. #25
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Interview Questions

    Another huge advantage to STORED PROCEDURES is that you do not have to give users access to TABLE's - only to the SPROCS.

    That way they cannot get at the data itself with a tool like EXCEL.

    Another issue that seems missing - since POINTER was mentioned first, then VARIABLE next - it should be stated that a CONSTANT does not have a POINTER to the VALUE in memory in the compiled code. It compiles down to the same code that would have been derived had the CONSTANT been replaced with a LITERAL value. Thus saving memory and a "pointer" lookup to a value.

    On DISCONNECTED recordsets - I personally do not agree that a connection should be closed. INSIDE MS SQL SERVER by KALEN DELANEY points out the "expense" of opening a connection (security wise, etc) - there is not reason to close a connection - in my opinion. DISCONNECTED recordsets are needed for all kinds of reasons - but not to simply eliminate a connection.

    Number of controls on a form - Me.Controls.Count (why use a default property??)

    I've got an MDI form with a TOOLBAR - which then becomes a container for a TAB STRIP (and combo box for that matter).

  26. #26
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Interview Questions

    We need some more answers. It's been 4 months!

  27. #27
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Post Re: Interview Questions

    I could provide new questions though.

    1) What does the linkmode property in a form do? [vb6]

    2) What is mutex?
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  28. #28
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Interview Questions

    Answer them also!

  29. #29
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Interview Questions

    This reply is not for us going for interviews, but for interviewers themselves....OK, my opinion so do not expect anyone to agree

    You should not ask direct programming questions! Like what control will you use for this, How do you do that...what's the point of this? Programming is not a language. Man, how do I say this...?

    A mute knows English well, but that does not enable you to speak. Any moron can learn a language and to use it, but a real programmer know how to solve problems, and don't give a damn when he's given a task he don't have a cooking clue how to solve, cuz he/she knows he will be able to figure it out...and no, those that copy and paste code from other sources...that does not count.

    Back to the point, I think it's completely unfair to ask questions like mentioned in the first thread to someone applying for a job..you are just gonna miss out on someone that will add real value to your company....
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width