This action might not be possible to undo. Are you sure you want to continue?
A reader sent these in noting that these questions were used in his company for interviewing prospective VB programmers. 1. 2. 3. 4. 5. 6. 7. How do you center a form? Can I send keystrokes to a DOS application? Convert an RGB value to a long, or a long to RGB. Implement smooth scrolling for either text, graphics or controls across a form. Implement some quick and easy encryption (can be something primitive). 4 different types of sorts: advantages and disadvantages. Compute CRC32 checksum, write a quick piece of code that accepts the packet of data and returns the CRC. How do you use the Mouse OFF event? How do I call Windows Help files from a VB program?
10. How do I create a textbox that lets you insert tabs? 11. How do I make text box that displays asterisks when the user types in data such as password? 12. How do I create multi-column combo box? 13. How do I make a menu popup from a CommandButton? 14. How to create menus at run time in VB? 15. Write a generic error handling routine. 16. How to copy text to the Windows clipboard and from it. 17. How can I call a Command button without clicking it? 18. Write a simple app with Encrypt and Decrypt buttons and Textbox where the user can enter text for encryption and decryption. ASP, ADO and IIS interview questions
This came in the mail from the reader who recently went through a job interview process. He didn¶t mention the company name. 1. 2. 3. 4. 5. 6. Why do you use Option Explicit? What are the commonly used data types in VBScript? What is a session object? What are the three objects of ADO? What are the lock-types available in ADO? Explain. What are the cursor types available in ADO? Explain.
7. There are three methods in that interface: AddRef. 5. How would you remotely administer IIS? 15. What is normalization? Explain normalization types. Start your answer from CoCreateInstance or CoCreateInstanceEx. explain the difference between them. What is a COM component? How do you register a COM component? What is a virtual root and how do you create one? 10. Otherwise. What is the disadvantage of creating an index in every column of a database table? 18. How can would you create an instance of the object in COM? Well. As soon as you fetch a record set. discuss its pros and cons? 11. 3. If interviewer is still not satisfied. all depends on the level of detail and expertise of interviewer. What is a bit datatype? What is it used for? 21. What is IUnknown? What methods are provided by IUnknown? It is a generally good idea to have an answer for this question if you claim you know COM in your resume. What are ACID properties of a transaction? 14. You have a query that runs slowly. What is aggregation? How can we get an interface of the aggregated object? Aggregation is the reuse mechanism. Release decrements reference counter of the object and QueryInterface obtains a pointer to the requested interface. What the limitations of CoCreateInstance? Well. Release and QueryInterface. You may also mention other methods of object creation like CoGetInstanceFromFile. but discussion will likely turn to discussion of monikers then. Start with simple explanation of class object and class factory mechanism. What is the difference between Request("field") and Request. What is RAID? What is it used for? 16. 8. 17. how do you create one. the major problems with CoCreateInstance is that it is only able to create one object and only on local system. What should QueryInterface functions do if requested object was not found? Return E_NOINTERFACE and nullify its out parameter. etc. . All other interfaces must derive directly or indirectly from IUnknown. To create a remote object or to get several objects. How would you go about securing IIS and MS-SQL Server? 22. What is a database index. you may consider your interview failed at this point. it all depends on your project. one should use CoCreateInstanceEx. you¶ll have to explain the whole kitchen behind the scenes. Further details would depend on a specific situation.Form("field")? COM interview questions 1. meaning and mechanism of class factory. IUnknown is the base interface of COM.NET environment? 20. in which the outer object exposes interfaces from the inner object as if they were 2. 7. 6. What are the purposes of AddRef. What are the uses of source control software? 19. based on single CLSID. 9. 4. Define a transaction. what operations would you perform? 13. How do you use multiple record sets (rs. What happens when client calls CoCreateInstance? Again. Release and QueryInterface functions? AddRef increments reference count of the object.NextRecordSet)? 12. at the same time. how would you make it better? How would you make it better in . including a difference between local server and inproc server.
8. 16. or ³Essential COM´ of Don Box for the further discussion on this topic.e. QI¶ing for IUnknown you may proceed and to get a pointer to any other interface. We can get a pointer to the inner interface. Idea behind MTA is that COM is not responsible to synchronize object calls between threads. Therefore.51 and late Windows 95 to isolate the problem of running legacy non-thread safe code into multithreaded environment. or free threading apartment) were introduced in NT 4. The question is not strict. Instead of accessing such an object remotely. What is a dual interface? Dual interface is one that supports both . but calls will be more efficient because they do not involve network round trips. Any DCOM object is yet a COM object (DCOM extends COM) and any COM object may participate in DCOM transactions. You may mention also that COM is a specification. The caller won¶t be able to notice the difference. This pointer will be returned to the client. Aggregation is actually a specialized case of containment/delegation. because OLE was built over COM for years. 13. such as MULTI_QI (multiple QueryInterface()). if any. Each thread was ³encapsulated´ into so called single-threaded apartment. 10. but only one of them may be default. 17. between OLE and COM? OLE is build on top of COM. calling QueryInterface of the outer object with IID of the inner interface. the state of the object does not change. 15. This is fundamental postulate of COM: ³If you can get there from here. What¶s the difference between COM and DCOM? Again. This is useful when the outer object would always delegate every call to one of its interfaces to the same interface in the inner object. What will happen? QueryInterface to A will delegate request to B which. you can get there from anywhere". while COM as a technology was presented by Microsoft a few years ago. Our client requested C. in turn. In the same way that a path identifies a file in the file system.0. Anyway. which in today¶s world is not exactly true as well. Multithreaded apartments (MTA.be prepared to this twist. to distinguish between different dual interfaces.IDispatch interface and vtbl-based interface. This is called ³marshaling by value". You may have two dual interfaces in one class. What is a multi-threaded apartment (MTA)? Single-threaded apartment (STA)? This is pretty difficult question to describe shortly. Discussion then may easily transform into analyzing of dual interface problems . 19. 9. without visible intervention of the object container. You need a surrogate process to do that. COM is responsible synchronize access to the object even if the object inside of the apartment is not thread-safe. Can you have two dual interfaces in one class? Yes. it might be used in scripting environment like VBScript and yet to use power and speed of vtbl-based interface for non-scripting environment. a moniker identifies a COM object in the directory namespace. which in turn aggregated by A. A moniker acts as a name that uniquely identifies a COM object. the question does not require strict answer. IDualInterface1). DCOM introduced several improvements/optimizations for distributed environment. 12. you can. Aggregated object exposes its interface directly. it is possible to copy the static state of the object and create a new object with the same state information on the caller side. See ³Professional DCOM Programming´ of Dr. Let¶s assume we have object B and aggregated object C (in-proc server). What is marshalling by value? Some objects can essentially be considered static: regardless of which methods are called. because what people call COM today is likely implementation of COM spec by Microsoft. DCOM demonstrated importance of surrogate process (you cannot run in-proc server on a remote machine. The bottom line is that you cannot work with two dual interfaces at the same time due to nature of dual interface! To support two dual interfaces in VB you would write something like: 14. created by B. Can you access any interface of B from C? What¶s the difference between aggregated and contained objects? Yes. security contexts etc. will delegate request for the interface to C. Contained object is created within the object container and its . and is available as a convenience to avoid extra implementation overhead in the outer object in these cases. supported by the object. 20. The reason to create an object in apartment is thread-safety. dim dim set set d1 d2 d1 d2 as IDualInterface1 as IDualInterface2 = new MyClassWithTwoDuals = d1 In ATL¶s class you would have to use macro COM_INTERFACE_ENTRY2(IDispatch. C is aggregated by B.implemented on the outer object itself. while OLE is a particular implementation of this specification. What is a moniker ? An object that implements the IMoniker interface. i. 11. In MTA the developer is responsible for that. What¶s the difference. apartments were introduced by Microsoft in NT 3. 18. Grimes et al.) DCOM introduced a load balancing.
Do not forget to call DLLUnregisterServer() from the same client.doc document a compound document? Is it a structured storage? Compound document is a document that contains information about other documents hosted in this document. VB 6.exe? Yes. 2. When you have to instantiate the in-proc object remotely. but may be not. Call DllRegisterServer() from the client. By definition. Moniker providers register an object in the table. 28. 31. 27. Microsoft platform interview questions 1. What is __declspec(novtable)? Why would you need this? __declspec(novtable) is a Microsoft¶s compiler optimization. If you have an object with two interfaces. Word documents from version 6. its moniker must be released from the table. 22. 7. DCOM. 32. i. RDO or ADO? . IDL is the language to describe COM interfaces. Give examples of OLE usage. 6. an object has to custom marshal all its interfaces or none of them. What is an IDL? IDL stands for Interface Definition Language. You may also use Registrar object for the same purpose or use direct manipulation of the windows registry. COM object that implemented as DLL and supposed to be hosted by a container. What is ROT ? GIT ? Count pros and cons of both. 3. Global Interface Table (GIT) allows any apartment (either single. The biggest disadvantage of VARIANT is size of the union. What is VARIANT? Why and where would you use it? VARIANT is a huge union containing automation type. COM. 25. All office documents _may_ be compound documents. The main idea of this optimization is to strip the vtable initialization code from abstract class (for abstract class the vtable is empty. How can you guarantee that only remote server is ever created by a client? Create an object (call CoCreateObjectEx()) with CLSCTX_REMOTE_SERVER flag. while it is initialized in contructor) MSDN has an article on this topic. This allows easy conversion of one automation type to another. Is there a way to register in-proc server without regsvr32.exe application that was design specially for this purpose. 21. 5. Before the object can be destroyed. 29. 24. Is . 4. running object table (ROT) is a globally accessible table on each computer that keeps track of all COM objects in the running state that can be identified by a moniker. which increments the object¶s reference count. What is OLE? OLE is an object and embedding first implementation of COM spec available from MS before COM was officially named COM. The most famous examples are probably drag and drop and structured storage implementations. you may use DLLHost.e. What is In-proc? In-proc is in-process COM object. 26. 3 main differences between flexgrid control and dbgrid control ActiveX and Types of ActiveX Components in VB Advantage of ActiveX Dll over ActiveX Exe Advantages of disconnected recordsets Benefit of wrapping database calls into MTS transactions Benefits of using MTS Can database schema be changed with DAO. can you custom marshal one of them? No! The decision to use custom marshaling is an all-or-nothing decision.or multi-threaded) in a process to get access to an interface implemented on an object in any other apartment in the process. 30.0 and up are stored as structured storage. 23.interfaces might be altered or filtered by the object container. What are 2 storage types for composite document? Storage and Stream.
container objects. image and picture controls. Default property of datacontrol 12. What kind of components can be used as DCOM servers? 23. Thread pool and management of threads within a thread pool 28. What does the Implements statement do? . How do I set a shortcut key for label? 22. Type Library and what is it¶s purpose? 30. Out of Process component. Private. Difference between a function and a subroutine.8. How does a DCOM component know where to instantiate itself? 20. what collection is responsible for input to stored procedures? 32. Friend procedures? 13. Can you create a tabletype of recordset in Jet-connected ODBC database engine? Constructors and destructors 10. Define the scope of Public. query unload and unload in form.resize a label control according to your caption.listbox and combo box. What are the different compatibility types when we create a COM component? 34. How can you force new objects to be created on new threads? 19. Name of the control used to call a Windows application 24. Return value of callback function. What does Option Explicit refer to? 36. Property used to add a menus at runtime. Need of zorder method. To set the command button for ESC. Types of system controls. Describe: In of Process vs. Describe Database Connection pooling relative to MTS 14.Listindex and Tab index. Name the four different cursor and locking types in ADO and describe them briefly 25. 26. combo box 31. Object and Class. Under the ADO Command Object. Controls which do not have events 11. 33.modal and moduless window. no of controls in form. What are the ADO objects? Explain them. What do ByVal and ByRef mean and which is the default? 35. How can objects on different threads communicate with one another? 18. 9. linked object and embedded Object. early and late binding. Property used to count number of items in a combobox. declaration and instantiation of an object? 16. Which is faster? 15. Dynaset and Snapshot. Which property needs to be changed? 29. How do I register a component? 21. The need of tabindex property 27. Draw and explain Sequence Model of DAO 17.
. Name the four different locking type in ADO and describe them briefly. What was introduced to Visual Basic to allow the use of Callback Functions? 43. and records created by other users are not detectedDynamic ? All changes are visible.dll Name and explain the different compatibility types when creating a COM component. What is the tool used to configure the port range and protocols for DCOM communications? Expected answer: DCOMCONFIG. What keyword is associated with raising system level events in VB? 40.37. 6. Which tool is used to configure the port range and protocols for DCOM communications? Note: This set of questions was sent in by a recruiter with no answers provided. Data is static and never changes. Expected answer: No Compatibility ? New GUID created. Usually that means that the interview is conducted by developers themselves who do not need a cheat sheet for the upcoming interview. 3. 8. Which controls can not be placed in MDI? 44. Their type is not required. can only move forward in recordset Static ? Can move to any record in the recordset. 5. How do you register a component? Expected answer: Compiling the component. Please consider looking into several in-depth titles on Visual Basic to find out the answers. Which controls have refresh method. I would gladly publish them. Which Property is used to compress a image in image control? 46. 38.CLASS?) orSet obj = GetObject( . What are the different ways to Declare and Instantiate an object in Visual Basic 6? Expected answer: Dim obj as OBJ. references from other components will work Why iss it important to use source control software for source code? Expected answer: Modification history.? OBJ. What methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful? 41.Forward Only ? Fastest. Visual Basic 1. If you¶re willing to send them or post them here. 9. What two methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful? Expected answer: SetComplete and SetAbort.Code ownership: Multiple people can not modify the same code at the same time. 4.CLASS Name the four different cursor types in ADO and describe them briefly. I don¶t have them. Expected answer: The cursor types are listed from least to most resource intensive. What is the maximum size of a textbox? 49. references from other components will not workProject Compatibility ? Default for a new component <Not as critical to mention this one>Binary Compatibility ? GUID does not change.CLASS?)orDim obj as New OBJ. records that are deleted by other users are unavailable. Which property of textbox cannot be changed at runtime? 48.CLASS with eitherSet obj = New OBJ.KeySet ? Changes are detectable. What types of data access have you used. and they prefer to ask the questions that they are intimately familiar with. Which property of menu cannot be set at run time? 47.EXE What does Option Explicit refer to? Expected answer: All variables must be declared before use. What is the difference between Msgbox Statement and MsgboxQ function? 39. running REGSVR32 MyDLL. What is OLE and DDE? Explain. 7. 42. clear method 45. Expected answer: 2.CLASS orSet obj = CreateObject(?OBJ.
ConnectionDim rs As ADODB. You can also add.OpenSet Cmd. The most likely is as follows:Dim conn As ADODB. or partial data. Database connections are put to ?sleep? as opposed to being created and destroyed and are activated upon request. Deployment.An out of process component is implemented as an EXE.Command: Used to build queries. Transactional operations. What is the benefit of wrapping database calls into MTS transactions? Expected answer: If database calls are made within the context of a transaction. contains the Errors collectionCommand ? Executes commands to the data source. What are the main components of the ADO object model? How are they used? Expected answer:Connection: Used to make a connection between your app and an external data source.Scenario: There are many possibilities. Out of Process component. 16. Remote Execution. Describe Database Connection pooling (relative to MTS ) Expected answer: This allows MTS to reuse database connections. . Under the ADO Command Object. modify or delete records. With a recordset.Commandconn. and unlike a dll. ie.LockPessimistic ? Locks the row once after any edits occur. you can navigate returned records. Expected answer: Connection ? Connects to a data source. Describe and In Process vs. This removes the possibility of stranded. including user-specific parameters. Can not alter the data. Is the only object that can accept parameters for a stored procedure. 10. 11.ActiveConnection = Nothingconn.ActiveConnection = connCmd.RecordsetDim Cmd As ADODB. runs in its own process space. A single instance of an out of process component can service many clients. 15. 13. Security. aborting the transaction will undo and changes that occur within that transaction. exe¶s are slower then dll¶s because communications between client and component must be marshalled across process boundaries. Which is faster? Expected answer:An inprocess component is implemented as a DLL.CommandText = ?SQL STATEMENT?Set rs = Cmd. enabling the most efficient communication between client and component. what collection is responsible for input to stored procedures? Expected answer: The Parameters collection. What are the ADO objects? Explain them. As a result. and runs in the same process space as its client app. What are some benefits of using MTS? Expected answer: Database Pooling.ConnectionString = ?CONNECTION STRING?conn. to access records from a data source (which are returned in a Recordset)Recordset:Used to access records returned from an SQL query.Close 12.LockReadOnly ? Read only.Each client app that uses the component starts a new instance of it.LockOptimistic ? Locks the row only when Update is called.Recordset ? The set of data returned from the database.LockBatchOptimistic ? Allows Batch Updates. 14. sql server. Provide a scenario using three of them to return data from a database.ExecuteSet rs.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.