面试时最经常被问到的问题(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 have multitasking capabilites (some people will try to tell you that the mac has "cooperative multitasking", but I wouldn't even cosider that multitasking, since it requires each running program to voluntarily pause and wait for others to run).

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

UNIX is 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&T waaaay back, Unix (no caps) usually refers to a family of operating systems (including the free-but-overrated Linux) that are based on UNIX. Solaris, BSD, OSF, SCO, and Tru64 are all flavors of Unix.

2How 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.

Traditional dos programming is procedural, meaning that your program starts at one place, and steps through the code sequentially.

Windows programming is event-based, meaning that each time an event (like a button-click) occurs; a handler is invoked to produce a response. The difference can be frustrating, since in event-driven code you can inadvertently have several functions running simultaneously on the same data.

3What is the advantage of Windows?

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

4What does winmain and wndproc do?

wndmain is the entry point for a win32 app (like main() would be in a dos/unix app). It is used in almost exactly the same way, except that you pass it a 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 program to process events that occur within it. The wndproc is specified when you call CreateWindow() and usually consists of several nested switch() statements.

5How does user input are trapped in Windows?

6Define and explain COM.

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

7What 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.

8What is Marshalling?

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

9Differences 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

10Describe a two tier Windows NT Domain.

11Describe 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

13How is a thread different from a process?

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

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

14How 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.

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

Because if you have a high performance webserver handling thousands of requests, if each of them spawns a new process this creates a lot of overhead. Threads are cheaper.

The reason you use a multi-process web server is for robustness in the face of failure. On a multithreaded server one thread can wipe out all the rest when it crashes the server. In a multi-process server only the offending process goes down. As far as speed is concerned most multi-process servers allow you to spawn at the beginning any number of processes to handle requests so speed differences on a running system are not much different between multi-threading and multi-process servers.

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

17Familiar with multi-reader, single writer locks?

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

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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值