计算机专业英文面试题,计算机英文面试题English question-technology.docx

1. Algorithms

* What’s the difference between a linked list and anarray?

Statically dynamically

Size is pre-defined

Storage:continuous

Peformance:

* Implement an algorithm to sort a linked list. Why did you pick the method you did?

Quicksort,mergesort

* Implement an algorithm to sort an array. Why didyou pick the method you did?

* Implement strstr() (or some other string libraryfunction).

* Reverse a string. Optimize for speed. Optimize forspace.

* Count the number of set bits in a number. Now optimize for speed. Now optimize for size.

* How would you find a cycle in a linked list?

* Give me an algorithm to shuffle a deck of cards,given that the cards are stored in an array of ints.

* Write a function that takes in a string parameterand checks to seewhether or not it is an integer, and if it is then return theintegervalue.

* Write a function to print all of the permutationsof a string.

* Implement malloc.

* Write a function to print the Fibonacci numbers.

* Write a function to copy two strings, A and B. Thelast few bytes of string A overlap the first few bytes of string B.

* How would you print out the data in a binary tree,level by level, starting at the top?

2. Applications

* How can computertechnology be integrated in anelevator system for a hundred storyoffice building? How do you optimize foravailability? How wouldvariation of traffic over a typical work week or flooror time of dayaffect this?

* How would you redesign an ATM?

* Suppose we wanted to run a microwave oven from thecomputer. What kind of software would you write to do this?

* How would you design a coffee-machine for anautomobile.

3. Thinkers

* How are M&Ms made?

* If you had to learn a new computer language, howwould you go about doing it?

* If MS told you we were willing to invest million ina start up of your choice, what business would you start? Why?

* If you could gather all of the computermanufacturers in the worldtogether into one room and then tell them one thingthat they would becompelled to do,what would it be?

* Explain a scenario for testing a salt shaker.

* If you are going to receive an award in 5 years,what is it for and who is the audience?

* How would you explain how to use Microsoft Excel toyour grandma?

* Why is it that when you turn on the hot water inany hotel, forexample, the hot water comes pouring out almost instantaneously?

Difference between the malloc() and the calloc()

Both the malloc() and the calloc() functions are used to allocate dynamic memory. Each operates slightly different from the other.

Both the malloc() and the calloc() functions are used to allocate dynamic memory. Each operates slightly different from the other.

malloc() takes a size and returns a pointer to a chunk of memory at least that big:

void *malloc( size_t size );

calloc() takes a number of elements, and the size of each, and returns a pointer to a chunk of memoryat least big enough to hold them all:

void *calloc( size_t numElements, size_t sizeOfElement );

There are one major difference and one minor difference between the two functions.

The major difference is that malloc() doesnt initialize the allocated memory.

The first time malloc() gives you a particular chunk of memory, the memory might be full of zeros.

If memory has been allocated, freed, and reallocated, it probably has whatever junk was left in it.

That means, unfortunately, that a program might run in simple cases (when memory is never reallocated) but break when used harder (and when memory is reused).

calloc() fills the allocated memory with all zero bits.

That means that anything there you are going to use as a char or an int of any length, signed or unsigned, is guaranteed to be zero.

Anything you are going to use as a pointer is set to all zero bits.

That is usually a null pointer, but it is not guaranteed.

Anything you are going to use as a float or double is set to all zero bits; that is a floating-point zero on some types of machines, but not on all.

The minor difference between the two is that calloc() returns an array of objects; malloc() returns one object.

Some people use calloc() to make clear that they want an array.

In computer science and telecommunication, interleaving is a way to arrange data in a non-contiguous way to increase performance.

Palindrome Number(判断一个整数数是否回文数)

展开阅读全文

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值