面试时最经常被问到的问题(Frenquently asked interview questions)(I) - Piggy and Jery 's GOLB - CSDN博客

来源:百度文库 编辑:神马文学网 时间:2024/04/28 07:37:04

 面试时最经常被问到的问题(Frenquently asked interview questions)(I)收藏

面试时最经常被问到的问题(Frenquently asked interview questions)之Java篇

Java Questions & Answers

1.    What is the difference between an Applet and an Application?

AJava application is made up of a main() method declared as public staticvoid that accepts a string array argument, along with any other classesthat main() calls. It lives in the environment that the host OSprovides.

AJava applet is made up of at least one public class that has to besubclassed from java.awt.Applet. The applet is confined to living in theuser's Web browser, and the browser's security rules, (or Sun'sappletviewer, which has fewer restrictions).

The differences between an applet and an application are as follows:

1.Applets can be embedded in HTML pages and downloaded over the Internetwhereas Applications have no special support in HTML for embedding ordownloading.

2.Applets can only be executed inside a java compatible container, such asa browser or appletviewer whereas Applications are executed at commandline by java.exe or jview.exe.

3.Applets execute under strict security limitations that disallow certainoperations(sandbox model security) whereas Applications have no inherentsecurity restrictions.

4.Applets don't have the main() method as in applications. Instead theyoperate on an entirely different mechanism where they are initialized byinit(),started by start(),stopped by stop() or destroyed by destroy().

2. What are java beans?

JavaBeansis a portable, platform-independent component model written in the Javaprogramming language, developed in collaboration with industry leaders.It enables developers to write reusable components once and run themanywhere -- benefiting from the platform-independent power of Javatechnology. JavaBeans acts as a Bridge between proprietary componentmodels and provides a seamless and powerful means for developers tobuild components that run in ActiveX container applications.

Javabeans is very powerful tool you can use in your servlet/JSP bridge. Youcan use the servlets to build the bean and can be passed over to theJSP for reading. This provides tight encapsulation of the data whilepreserving the sanctity of servlets and JSP.

3. What is RMI?

RMIstands for Remote Method Invocation. Traditional approaches toexecuting code on other machines across a network have been confusing aswell as tedious and error-prone to implement. The nicest way to thinkabout this problem is that some object happens to live on anothermachine, and that you can send a message to the remote object and get aresult as if the object lived on your local machine. This simplificationis exactly what Java Remote Method Invocation (RMI) allows you to do.

4. What gives java it's "write once and run anywhere" nature?

Javais compiled to be a byte code which is the intermediate languagebetween source code and machine code. This byte code is not platormspecific and hence can be fed to any platform. After being fed to theJVM, which is specific to a particular operating system, the codeplatform specific machine code is generated thus making java platformindependent.

5. How does Java inheritance work?

Aclass can only directly extend one class at a time. Multiple inheritanceis only allowed with regard to interfaces. A class can implement manyinterfaces. But a class can only extend one non-interface class.

6. What are native methods? How do you use them?

Native methods are used when the implementation of a particular method is present in language other than Java say C, C++.
To use the native methods in java we use the keyword native
public native method_a()
This native keyword is signal to the java compiler that the implementation of this method is in a language other than java.
Nativemethods are used when we realize that it would take up a lot of reworkto write that piece of already existing code in other language to java.

7. Class A subclass B subclass C. All override foo(). I cast C to A and call foo(). What happens? Can C call A->foo()?

An instance of Class C is of type Class B and A (both). SO you can cast C to A. You CANNOT cast an instance of A to C.

8. What does the "static" keyword mean in front of a variable? A method? A class? Curly braces {}?

-- static variables: These are class level variable whose value remain same irrespective of the number of instances of the class.

-- static methods:
Theseare those methods that can be called without the need for creating theobjects of the class i.e. they are class level methods. They can callonly static methods. They cannot refer to "this" as they are notassociated with any particular instance.

--static block: These are called before the main is called and are calledonly once. Subsequent invocation of the java program containing staticblock would not call it again. Hence, they can be used to load librariessay in native function call.

-- Only Inner class could be declared as a "static". This declaration suppress the generation of the reference to the outer class object. 这意味着:1)为创建一个static内部类的对象,我们不需要一个外部类对象;2)不能从static内部类对象访问一个外部类对象。

9. How many different types of JDBC drivers are present? Discuss them.

There are four JDBC driver types.

Type 1: JDBC-ODBC Bridge plus ODBC Driver:
The first type of JDBC driver is the JDBC-ODBC Bridge.It is a driver that provides JDBC access to databases through ODBCdrivers. The ODBC driver must be configured on the client for the bridgeto work. This driver type is commonly used for prototyping or whenthere is no JDBC driver available for a particular DBMS.

Type 2: Native-API partly-Java Driver:
TheNative to API driver converts JDBC commands to DBMS-specific nativecalls. This is much like the restriction of Type 1 drivers. The clientmust have some binary code loaded on its machine. These drivers do havean advantage over Type 1 drivers because they interface directly withthe database.

Type 3: JDBC-Net Pure Java Driver:
TheJDBC-Net drivers are a three-tier solution. This type of drivertranslates JDBC calls into a database-independent network protocol thatis sent to a middleware server. This server then translates thisDBMS-independent protocol into a DBMS-specific protocol, which is sentto a particular database. The results are then routed back through themiddleware server and sent back to the client. This type of solutionmakes it possible to implement a pure Java client. It also makes itpossible to swap databases without affecting the client.

Type 4: Native-Protocol Pure Java Driver
Theseare pure Java drivers that communicate directly with the vendor'sdatabase. They do this by converting JDBC commands directly into thedatabase engine's native protocol. This driver has no additionaltranslation or middleware layer, which improves performancetremendously.

10. Does Java have "goto"?

Yesand No. There is no "goto" operator used in Java, but it is a reservedkeyword, and one can use break statements to branch to a labelledstatement, exactly as one would use a goto.

11. Why "bytecode"? Can you reverse-engineer the code from bytecode?

yes, with some tools.

12. How does exception handling work in Java?

1.It separates the working/functional code from the error-handling code by way of try-catch clauses.

2.Itallows a clean path for error propagation. If the called methodencounters a situation it can't manage, it can throw an exception andlet the calling method deal with it.

3.Byenlisting the compiler to ensure that "exceptional" situations areanticipated and accounted for, it enforces powerful coding.

4.Exceptionsare of two types: Compiler-enforced exceptions, or checked exceptionsand Runtime exceptions, or unchecked exceptions. Compiler-enforced(checked) exceptions are instances of the Exception class or one of itssubclasses -- excluding the RuntimeException branch. The compilerexpects all checked exceptions to be appropriately handled. Checkedexceptions must be declared in the throws clause of the method throwingthem -- assuming, of course, they're not being caught within that samemethod. The calling method must take care of these exceptions by eithercatching or declaring them in its throws clause. Thus, making anexception checked forces us to pay heed to the possibility of it beingthrown. An example of a checked exception is java.io.IOException. As thename suggests, it throws whenever an input/output operation isabnormally terminated.

13. Does Java have destructors?

Javadoes not have destructors. Garbage collector does this job periodicallydepending upon the memory requirements of the machine and on the factthat a particular object is no longer needed.

But it has finalizers that does a similar job. The syntax is
public void finalize() { }

Ifan object has a finalizer, the method is invoked before the systemgarbage collects the object, but using finalize() does not guaranteethat it would be called b4 garbage collector is invoked.

14. What does the "final" keyword mean in front of a variable? A method? A class?

A final variable cannot be reassigned, but it is not constant. For instance,
final StringBuffer x = new StringBuffer();
x.append("hello");

isvalid. X cannot have a new value in it, but nothing stops operations onthe object that it refers, including destructive operations.

Also,a final method cannot be overridden or hidden by new accessspecifications. This means that the compiler can choose to in-line theinvocation of such a method. (I don't know if any compiler actually doesthis, but it's true in theory.)

The best example of a final class is String, which defines a class that cannot be derived.

15. Access specifiers: "public", "protected", "private", nothing?

Public?  Any other class from any package can instantiate and execute the classes and methods
Protected? Only subclasses and classes inside of the package can access the classes and methods
Private? The original class is the only class allowed to execute the methods.
Andin case if there is no modifier specified, it means, only the classesinside the package can access this class and its methods, it is alsocalled "Friendly".


面试时最经常被问到的问题(Frenquently asked interview questions)之 Databases 篇

Databases Questions & Answers

1.      What are two methods of retrieving SQL?
Answer:

2.      What cursor type do you use to retrieve multiple recordsets?
Answer:

3.      What action do you have to perform before retrieving data from the next result set of a stored procedure?
Answer:
Movethe cursor down one row from its current position. A ResultSet cursoris initially positioned before the first row. Before you can get to thefirst row, you would need to Move the cursor down by one row ( For ex:in java the first call to next makes the first row the current row; thesecond call makes the second row the current row, and so on).

4.      What is the basic form of a SQL statement to read data out of a table?
Answer:
SELECT * FROM table_name;

5.      What structure can you have the database make to speed up table reads?
Answer: Thequestion is not correct. "What structure can you have the database maketo speed up table reads?" It is not clear what exactly the term"structure" means in this case. Follow the rules of DB tuning we haveto:
1) properly use indexes ( different types of indexes)
2) properly locate different DB objects across different tablespaces, files and so on.
3) Create a special space (tablespace) to locate some of the data with special datatypes( for example CLOB, LOB and ...)
4)...
5)...

6.      What is a "join"?
Answer:
Joins merge the data of two related tables into a single result set, presenting a denormalized view of the data.

7.      What is a "constraint"?
Answer:
Aconstraint allows you to apply simple referential integrity checks to atable. There are 5 primary types of constraints that are currentlysupported by SQL Server:
PRIMARY/UNIQUE - enforces uniqueness of a particular table column.
DEFAULT - specifies a default value for a column in case an insert operation does not provide one.
FOREIGN KEY - validates that every value in a column exists in a column of another table.
CHECK - checks that every value stored in a column is in some specified list
NOT NULL- is a constraint which does not allow values in the specific column tobe null. And also it is the only constraint which is not a table levelconstraint.

8.      What is a "primary key"?
Answer:
PrimaryKey is a type of a constraint enforcing uniqueness and data integrityfor each row of a table. All columns participating in a primary keyconstraint must possess the NOT NULL property.

9.      What is a "functional dependency"? How does it relate to database table design?
Answer:
What functional dependencein the context of a database means is that: Assume that a table existsin the database called TABLE with a composite primary key (A, B) andother non-key attributes (C, D, E). Functional dependency in general,would mean that any non-key attribute - C D or E being dependent on theprimary key (A and B) in our table here.
Partial functional dependency,on the other hand, is another corollary of the above, which states thatall non-key attributes - C D or E - if dependent on the subset of theprimary key (A and B) and not on it as a whole.
Example :
----------
Fully Functional Dependent : C D E --> A B
Partial Functional dependency : C --> A,  D E --> B
Hope that helps!

10.  What is a "trigger"?
Answer:
Atrigger is a database object directly associated with a particulartable. It fires whenever a specific statement/type of statement isissued against that table. The types of statements are insert, update,delete and query statements. Basically, trigger is a set of SQLstatements that execute in response to a data modification/retrievalevent on a table.
Other than table triggers there are also schema anddatabase triggers. These can be made to fire when new objects arecreated, when a user logs in, when the database shutdown etc. Tablelevel triggers can be classified into row and statement level triggersand those can be further broken down into before and after triggers.Before triggers can modify data.

11.  What is "index covering" of a query?
Answer:
Anonclustered index that includes (or covers) all columns used in aquery is called a covering index. When SQL server can use a nonclusteredindex to resolve the query, it will prefer to scan theindex rather than the table, which typically takes fewer data pages. Ifyour query uses only columns included in the index, then SQL server may scan this index to produce the desired output.

12. What is a SQL view?
Answer: Viewis a precomplied SQL query which is used to select data from one ormore tables. A view is like a table but it doesn't physically take anyspace. View is a good way to present data in a particular format if youuse that query quite often.
View can also be used to restrict users from accessing the tables directly.
Aview otherwise known as a virtual table is a mere window over the basetables in the database. This helps us gain a couple of advantages:
1) Inherent security exposing only the data that is needed to be shown to the end user
2)Views are updateable based on certain conditions. For example, updatescan only be directed to one underlying table of the view. Aftermodification if the rows or columns don't comply with the conditionsthat the view was created with, those rows disappear from the view. Youcould use the CHECK OPTION with the view definition, to make sure thatany updates to make the rows invalid will not be permitted to run.
3)Views are not materialized (given a physical structure) in a database.Each time a view is queried the definition stored in the database is runagainst the base tables to retrieve the data. One exception to this isto create a clustered index on the view to make it persistent in thedatabase. Once you create a clustered index on the view, you can createany number of non-clustered indexes on the view.

面试时最经常被问到的问题(Frenquently asked interview questions)之Internet Technologies篇

Internet Technologies Questions & Answers

1、              What is HTTP? How does it work (in basic terms)?

HTTP:(HyperText Transport Protocol) The communications protocol used toconnect to servers on the World Wide Web. Its primary function is toestablish a connection with a Web server and transmit HTML pages to theclient browser. Addresses of Web sites begin with an http:// prefix;however, Web browsers typically default to the HTTP protocol. Webbrowsers communicate with Web servers via the TCP/IP protocol. Thebrowser sends HTTP requests to the server, which responds with HTMLpages and possibly additional programs in the form of ActiveX controlsor Java applets.

2、              What is a CGI program? How does one get invoked?

CGI(CommonGateway Interface script) A small program written in a language such asPerl, Tcl, C or C++ that functions as the glue between HTML pages andother programs on the Web server. For example, a CGI script would allowsearch data entered on a Web page to be sent to the DBMS (databasemanagement system) for lookup. It would also format the results of thatsearch as an HTML page and send it back to the user. The CGI scriptresides in the server and obtains the data from the user via environmentvariables that the Web server makes available to it.
CGI scriptshave been the initial mechanism used to make Web sites interact withdatabases and other applications. However, as the Web evolved,server-side processing methods have been developed that are moreefficient and easier to program. For example, Microsoft promotes itsActive Server Pages (ASPs) for its Windows Web servers, and Sun/Netscapenurtures its Java roots with JavaServer Pages (JSPs) and servlets

3、              What is the difference between GET and POST methods of submitting form data?

get--This has a limit as to number of characters that it can pass. In getthe request is sent in the the form of a query string from the webbrowser to the web server. The max. no. of characters that can be passedare 255. Since the request is sent in the query string that is visiblein the address bar of the web browser, this method is not suited forpassing confidential info. such as passwords/credit card no's etc.

post--There is no such limit on the no. of characters that can be passed at atime as the request is passed in the body of the message. So this isuseful for passing confidential data. Also, one can pass any length ofinfo. to the server.

4、              What is "URL Encoding"?

URL Encoding is a method by which a string is converted into a format which is suitable for HTTP URL.
Example : Server.URLEncode("sitename=imilap")
Results is sitename%3Dimilap. = is converted into characters which can be used in the URL

5、              What is an HTML "entity"?

Characterentity references, or entities for short, provide a method of enteringcharacters that cannot be expressed in the document's character encodingor that cannot easily be entered on a keyboard. Entities arecase-sensitive and take the form &name;. Examples of entitiesinclude © for the copyright symbol and Α for theGreek capital letter alpha.

6、              How can you do a "redirect" to another page?

This is easily achieved using the Meta tag as below

ButI think there are 2 aspects of the problem, redirect from the clientside or the server side. As to the client side, if we are usingVBScript, just call the navigate method of window object is OK, if not,we can set the window object’s location.href property to the URL of thetarget page. As to the server side, if differs from languages tolanguages.

7、              What web servers do you have experience with? Apache? IIS?

8、              How does an XML DTD work, and what are some of its limitations?

XML DTD: Extensible Markup Language Document Type Definition. Itis to define the legal building blocks of an XML document. It definesthe document structure with a list of legal elements. A DTD can bedeclared inline in your XML document, or as an external reference.

The drawbacks of DTD:
1) DTD doesn’t comply with the XML syntax,
2) The data types of DTD is limited,
3) DTD is not extensible,
4) DTD doesn’t support namespace.

9、              What are session variables?

Whena user logs in a web site a session is created. Session variables are avariable which remain active throughout this session.

The use of Session variables is to store information pertinent to that particular session. Example: user preferences etc.

10、          What problems do the vendors of ODBC Technology face with ASP/ADO?

ADO's apartment threaded, and ASP doesn't support threading at all.
The main problem would be locking unnecessarily or dead-locking when multiple requests are made thru the same connection object.

11、          What are the three tags of a form tag in HTML form?

ACTION, METHOD, Target and EncType (encoding type)

12、          What are the two tags for framesets?

Frameset, frame and noframes. Example:




<br><p>This page uses frames, but your browser doesn't support them.<br>

13、          How do you create Drop Down Combos in HTML?

Using Select tag. Example:

14、          In DHTML what is the difference between FontSize and Font Size?

FontSize is a property, Font Size is a style.

15、          What is the tag CodeBase and why do we use it?

Afterwriting and compiling a Java applet, you can display it in a web pageby using the APPLET tag. The CODE attribute specifies the name of theJava applet to run. The CODEBASE attribute specifies the subdirectory orfolder containing the Java applet. You can use PARAM tags between the and tags to provide information aboutparameters, or arguments, to be used by the Java applet.

Syntax
CODE="classFileName"
CODEBASE="classFileDirectory"
ARCHIVE="archiveFile"
ALT="altText"
ALIGN="LEFT"|"RIGHT"|"TOP"|"ABSMIDDLE"|"ABSBOTTOM"| "TEXTTOP"| "MIDDLE" | "BASELINE" | "BOTTOM"
HEIGHT="height"
WIDTH="width"
HSPACE="horizMargin"
VSPACE="vertMargin"
NAME="value"
>


TheCODE attribute is required (otherwise there is no applet to run).Netscape Navigator 3 and Navigator 4 can display applets if the WIDTHand HEIGHT attributes are omitted, but some other browsers cannot, sofor best results you should always include the WIDTH and HEIGHTattributes.

CODE ="classFileName"
specifiesthe filename of the applet to load. All Java class files end with a.class extension (for example, myApplet.class). Many browsers willdisplay the applet correctly even if you omit the .class extension inthe filename.

CODEBASE="classFileDirectory"
isthe directory containing the applet class file and any resources theapplet needs. The value is a URL for an absolute or a relative pathname.An absolute URL is used as is without modification and is not affectedby the document's BASE tag. A relative CODEBASE attribute is relative tothe document's base URL defined by the BASE tag. If the document doesnot define a BASE tag, it is relative to the directory containing theHTML file.

Forshort, the code property indicates the Qualified Class Name (includingpackage name), ending with .class or not is both OK; the codebase is thewell known classpath!

16、          Walk me through the OSI seven-layer model, then explain at what layer a switch, router and hub all operates.


7. Application layer
6. presentation layer
5. Session layer
4. Transport layer
3. Network layer
2. Datalink layer
1. Physical layer


Ahub is a physical layer device providing absolute NO intelligence. Aswitch is a data link layer device which isolates collision domains vs.routers which isolate broadcast domains, giving each connection to aswitch a "private" connecting (no collisions/contention). Think of aswitch as a multi-port bridge of sorts, allocation a time slice to eachconnection, but very quickly.

17、          Describe how DNS works. Describe the difference between a resolver and an authoritative master server.

18、          Describe TCP/IP and it's components. What is ARP/RARP? What does a TCP/IP packet looks like?
 
Address Resolution Protocol (ARP) performs IP address-to-Media Access Control (MAC) address resolution for outgoing packets.

19、          Describe the process that happens when you click a link in your web browser to fetch another web page.

20、          How would you design the web page for a company that sells screws?

How can you have different number of cells for each row of a table?
Itsjust sufficient to give the number of column tags within therow tags ... and its fine if the cells are varying within each rows.
Colspanwill help you keep the alignment of your overall table, that is avoidsthe step or zig-zag pattern due to different no. of cells in differentrows.

面试时最经常被问到的问题(Frenquently asked interview questions)之Misc. Topics篇

Misc. Topics Questions & Answers

1. Differences between Mac, Windows, UNIX

MacOS(up until osX, anyhow) was single-user and (technically) did not havemultitasking capabilites (some people will try to tell you that the machas "cooperative multitasking", but I wouldn't even cosider thatmultitasking, since it requires each running program to voluntarilypause and wait for others to run).

Windows,starting with Win95 (*) is a single-user, multasking OS. Although newerversions like XP and 2000 support file permissions via EFS, the DO NOTallow multiple users to be logged in at once. (NEWS: win 2003 supportthis)

UNIXis 100% multi-user and multitasking, and is therefore (why therefore?)inherently stable, secure, and confusing. Once you go UNIX, though,you'll never go back! UNIX (in all caps) was developed by AT&Twaaaay back, Unix (no caps) usually refers to a family of operatingsystems (including the free-but-overrated Linux) that are based on UNIX.Solaris, BSD, OSF, SCO, and Tru64 are all flavors of Unix.

2.How does Windows programming differ from DOS programming?

Windows – GUI                                                DOS - CUI.
Windows - 32bit O.S                                        Dos is 16 bit O.S.
Windows - multithreading and multitasking O.S     Dos is stranger to these concepts.

Traditionaldos programming is procedural, meaning that your program starts at oneplace, and steps through the code sequentially.

Windowsprogramming is event-based, meaning that each time an event (like abutton-click) occurs; a handler is invoked to produce a response. Thedifference can be frustrating, since in event-driven code you caninadvertently have several functions running simultaneously on the samedata.

3.What is the advantage of Windows?

GUI,Multitasking, Multithreaded O.S., you can also add: supports a vastvariety of devices and has a large base of developers and software.

4.What does winmain and wndproc do?

wndmainis the entry point for a win32 app (like main() would be in a dos/unixapp). It is used in almost exactly the same way, except that you pass ita lot of worthless params that your code probably won't use anyhow.

wndproc(aka "window procedure") is a function that will be run by your programto process events that occur within it. The wndproc is specified whenyou call CreateWindow() and usually consists of several nested switch()statements.

5.How does user input are trapped in Windows?

6.Define and explain COM.

COM is a binary standard on Microsoft (and some UNIX platforms) that enables objects to interoperatein a networked environment regardless of the language in which theywere developed or on which computers they reside. COM allows an objectto expose its functionality to other components and to hostapplications. It defines both how the object exposes itself and how thisexposure works across processes and across networks. COM also definesthe object's life cycle.

7.What is IUnknown and what are its three parts?

IUnknown is the Basic COM interface on which all others are based on.
The Three methods of IUnknown are
1) QueryInterface
2) Addref
3) Release
All the COM interfaces inherit these three methods from IUnknown.

8.What is Marshalling?

Marshalling is the process of converting data into a format for transferring over the network.

9.Differences between Windows 3.1, Windows 95/98, and Windows NT

Windows 3.1 : 16-bit
Windows 9x : 32-bit
Windows NT : 32-bit, more secure, users must login

10.Describe a two tier Windows NT Domain.

11.Describe the file system layout in the UNIX OS.

Bin, boot, dev, etc, home, initrd, lib, lost+found, misc, mnt, opt, proc, root, sbin, tmp, usr, var…

12In UNIX, are the files allocated contiguous blocks of data?
a) if no, how is the fragmented data kept track of
b) describe the direct blocks and indirect blocks in UNIX file system

13.How is a thread different from a process?

A process runs in its own address space. No two processes share their address space.

Threadswill run in the same address space of the process that owns them.Threads belonging to the same process will run in the same addressspace. They will also share the process's stack and heap. No twoprocesses will share their stacks or their heaps.

14.How is multithreading useful for a web server? A browser?

Web Servers are typically capable of serving multiple clients concurrently, this is achieved using Multi Threading.

15.Why not use multi-process for this? Why would you WANT to run a multi-process web server?

Becauseif you have a high performance webserver handling thousands ofrequests, if each of them spawns a new process this creates a lot ofoverhead. Threads are cheaper.

Thereason you use a multi-process web server is for robustness in the faceof failure. On a multithreaded server one thread can wipe out all therest when it crashes the server. In a multi-process server only theoffending process goes down. As far as speed is concerned mostmulti-process servers allow you to spawn at the beginning any number ofprocesses to handle requests so speed differences on a running systemare not much different between multi-threading and multi-processservers.

16.Whatlocking constructs are available on platform X (NT = semaphore,critical section, mutex), What are the main differences between them?

17.Familiar with multi-reader, single writer locks?

18.How could you implement that given a simple binary semaphore OS construct?

19.How does this implementation behave? Can it starve readers? Starve writers?



面试时最经常被问到的问题(Frenquently asked interview questions)之General / Fundamentals篇

General / Fundamentals Questions & Answers

1.            How would you redesign an ATM?

--ATMmachine would "eat" your card if you give "three strikes" failure. Thisis what I hate the most. So I would add a feature so that a user couldregain the card. For example, let user have way to add a secretequestion and answer to that question.

--I would eliminate the need for a physical card an opt for some kind of biometric id such as a retinal scan or some such.

--I would orient the display to eliminate the opportunity for overlookers to view it - ie. make it horizontal like a table.

--Iwould eliminate the masking of account information behind names such as'checking', 'savings', etc. and ensure that at least the balances arealways displayed. This would help eliminate a good deal of 'you don'thave enough funds'-type msgs.

--Addan Undo capability where appropriate, i.e. for transfers/deposits. Itwould also negate any costs associated with the original transaction.

--Remember the most common transactions done by the user and make them macros automatically.

--Iwould add a way for the system to intermingle different languagesduring the transaction. This way, you could learn how to take out moneyin foreign languages while you were at the bank machine. Cool.

--Somepossibilities are: security, user interface, user privacy, minimizedatacom traffic, make ATM cheaper to build/program. Like allengineering, it's a matter of balancing tradeoffs. If we were optimizingfor user interface, the first thing to do is to analyze what we'redoing to annoy current users and stop doing that (application of basicHippocratic Oath "above all do no harm"). One basic UI problem I'venoticed with many ATMs is that the keyboard is not near the screen.Users need to keep shifting eye focus. This change might make ATMs moreexpensive to build... so we're back to making engineering tradeoffs.

2.What is a balanced tree?

Abinary tree is balanced if the depth of two subtrees of every nodenever differs by more than one, can also be called AVL trees.

3.How would you decide what to test for given that there isn't enough time to test everything you want to?

--Prioritize what you want to test, in the order,
.
whether is taking right input and giving right output,
.whether all the output conditions expected are meet,
.which really can crash the system, checking the boundary conditions
.which really annoy the user, hanging etc.
.Which can cause loss of data, like memory corruption, memory leaks etc?

--Usethe requirements to dictate your tests. If your product satify therequirments, then you can ship it. That's how they do it a MS. :-)

--Ifyou are a tester, ask the developer or the manager for more time orsimply automize a part of testing so that multiple parts of the systemcan be tested in parallel. The product should and cannot be shippedwithout complete testing.

--The goal of any project is to test the entire code base, but in realitythat doesn't always happen. In many cases a 'ship date' is dictated andchanging it, to allow more testing, is not in a company's bestinterests. The quality of a product is a factor similar to features andresources required. Testing for most products should be prioritized thesame way features are.

So, automate as much as possible and ensure that the most important features are tested.

4.What is Lex? Yacc? What are they used for?

5.Tell me about fundamentals of RPC.

RemoteProcedure Call (RPC) is a protocol that one program can use to request aservice from a program located in another computer in a network withouthaving to understand network details. (A procedure call is alsosometimes known as a function call or a subroutine call.) RPC uses theclient/server model. The requesting program is a client and theservice-providing program is the server. Like a regular or localprocedure call, an RPC is a synchronous operation requiring therequesting program to be suspended until the results of the remoteprocedure are returned. However, the use of lightweight processes orthreads that share the same address space allows multiple RPCs to beperformed concurrently.

When program statements that use RPC arecompiled into an executable program, a stub is included in the compiledcode that acts as the representative of the remote procedure code. Whenthe program is run and the procedure call is issued, the stub receivesthe request and forwards it to a client runtime program in the localcomputer. The client runtime program has the knowledge of how to addressthe remote computer and server application and sends the message acrossthe network that requests the remote procedure. Similarly, the serverincludes a runtime program and stub that interface with the remoteprocedure itself. Results are returned the same way.

6.Tradeoff between time spent in testing a product and getting into the market first.

-- In Microsoft’s case. Ship it out. Who cares about bugs...just fix it in the next release.

--I think it depends more on the market situation...many a times, in thehi-tech market, you are going to be able to sell only if u are the firstguy out with the product. It is really really important to be themarket pioneer. If the market demands it, u better get the product outand ask the developers and testers to go to hell. Getting a prototype ofthe product into the market is the least you can do. At the same timeif you can afford the time (no pressure from competitors, new entrants,substitute products or buyers) then do as much as testing as possible.

The balance between testing and the release should totally depend on the market!

7.You're part of the QA team for alarge web-site. You want to create as much automated testing aspossible. What could/would you test? How? How much maintenance wouldthese tests require as the web site changes?

I would write automated tests that do the following:

1. A poller that just checks to see if the site is up and running.
2. A test that pushes a lot of test data to the site and measure time taken for push.
3. A test that pulls a lot of test data from site and measure time taken.
4. Programatically invoke applets, ActiveX controls and verify results of operation.
5. Simulate a multiple user scenario and stress out the web site, determine its breaking point.

8.What would be your language of choice for implementing CGI programs on a web server? Why?

I think Perl has extremely flexible and not a strict language by any means. Ideal for quick and dirty (?) web applications.

9.How do you multiply a variable by 16 without using the multiplication operator '*'?

10.How do you swap two integers without using any extra memory?


a=a+b;
b=a-b;
a=a-b;

a becomes (a XOR b)
b becomes (b XOR a)
a becomes (a XOR b)

// only when b <> 0
a = a * b;
b = a / b;
a = a / b


11.What was the most difficult program you had to write?

12.Describe the most interesting software project you've done in school.

13.Name 7 layers of OSI models and define their functionality.


7. Electrical/Physical
----------------------
Responsiblefor defining various Electrical standards, like standardized Cables,Bit Stream Standards etc, to be used while communicating between HOSTS(Computers).


6. Link Layer
-------------
Responsible for Encoding & subsequent
De-Coding of Data Packets at various
Network points.

5. Network Layer
----------------
Responsible for providing LOGICAL paths for
Data packets to pass through. It basically
provides SWITCHING & ROUTING facilities.

4. Transport Layer
------------------
Responsible for TRANPARENT flow of data
between HOSTS (Computers), without due
consideration to HARDWARE details. This
layer is not concerned as to which
applications are sharing data; rather it
is only concerned with TRANSFERRING
DATA PACKETS FROM ONE POINT TO ANOTHER-

3. Session Layer
----------------
Responsible for maintaining a REGISTRY of
all currently active connections from
various HOSTS (Computers).

2. Presentation Layer
---------------------
Responsible for isolating different Data
formats from each other. Ex.: Encryption
process involves the AUTOMATIC conversion
of Application data Format to Network Format
& Vice-Versa.

1. Application Layer
--------------------
Responsible for END-USER friendly protocols,
like HTTP, FTP, TELNET etc. Software
Developers directly interact with this
layer of protocol to write programs.

1、项目进入实现(implementation)阶段,发现原计划3个月的开发根本无法完成,你会采取什么措施?
2、做需求交流的时候,你对一个流程不明白,而客户方也不清楚,你该怎么办?

答---------------------
第一个问题:
  1)弄清楚现在的处境,项目进行的阶段;
  2)弄明白接下来要做的事情,根据实际的需求,通过添加资源就可以完成的添加资源(包括时间和人力),要是添加再多人力无法完成的就砍功能;
  3)排定新的计划。

第二个问题:
  1)试探性的从客户那里挖掘他真正想表达的东西。

-----------------------
1.确立在项目延期后会给公司超成什么损失,量化损失
  我不赞成在项目无法完成的时候增加人力,这会事得其反
  深入找到项目延期的问题根源,如果是人力问题,或者是人员问题(人力问题和人员问题是两个不同的问题),或者是其它问题,针对问题进行研究,而且项目合同只有功能,流程的定格,可以在界面,操作上进行简化,提高项目速度
  做为项目经理来说,要以技术支持和热情代动Team,把不可能变成可能

2.这个是一个方法问题,如果真面试的时候,再说吧

--------------------------
1.寻找突破口,--集中精力尽量补救 --完成部分组织评审 --未完成部分申请延期
2.进入客户的角色(企业文化/工作环境/思维方式等)-- 换位思考 -- 提出思路进行商讨 ---改进流程--部门调研确认 --修改、结束
------------------------
第一個問題﹕
我記得一個項目真正要做好要管理好九個方面﹕
整合﹐成本﹐溝通﹐視角
質量﹐風險﹐時間﹐人員和涉外采購。
首先找出是哪個環節出了問題﹐然后對症下藥。
其次勇敢說NO﹐對于主要的勇敢說YES。

第二個問題﹐
1搞清楚為什么他不清楚這個需求
2做模型或者提問題匯總需求或者轉換SCOPE
-------------------------------
我当时的回答是:
1、如果没有什么别的办法,就只好砍功能了。我们都知道软件开发中的二八原理,即主要的80%的功能是20%的代码完成的,其他的80%的代码一般是实现一些辅助的功能。因此我们可以想办法在这80%中想办法看看能不能砍。(面试的一听就乐了,连连点头。我心里想:靠,地道的JS!)
2、这是需求分析中常常遇到的问题。我一般的处理方法是冷处理,即如果客户不知道,引导了也不知道,那就干脆放一放,把其他的他清楚的地方做完了再说。就象我们画画,可以先勾勒出轮廓,轮廓出来了,细节就比较好处理。(面试的听了只点头,我心里想:靠,应当找你收学费的!)


 

发表于 @2004年11月17日 22:39:00 | 评论( 4) | 编辑| 举报| 收藏

旧一篇:今天面试IBM CSDL | 新一篇:面试时最经常被问到的问题(Frenquently asked interview questions)(II)

查看最新精华文章 请访问博客首页相关文章
面试时最经常被问到的问题(Frenquently asked interview questions)之Java篇
Frenquently asked interview questions
An Open Letter to Object Technology Newcomers (要求有软件工程知识)
30 Java Interview Questions
面试时最经常被问到的问题(Frenquently asked interview questions)(II)
Interview and work experience
面试时最经常被问到的问题(Frenquently asked interview questions)之Misc. Topics篇
面试时最经常被问到的问题(Frenquently asked interview questions)之C/C++篇