一些面试问题 [英] Some Interview Questions

查看:73
本文介绍了一些面试问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天在接受采访时遇到了这些问题:

1.使用C定义一个类。

2.编写一个执行垃圾收集的C函数:释放所有

分配回忆。

3.定义信号量。

4.什么是并行编程以及你会遇到什么样的问题

面对这种程序?

如果有人给出了第一个和第二个问题的答案,我会赞不绝口。

问候,

Matt

解决方案

2004年10月25日16:43:32 -0700, ma ******** @ hotmail.com (马特)在

comp.lang.c中写道:

我今天在接受采访时遇到了这些问题:

1.用C语言定义一个班级。


C没有任何名为''class''的东西。

2.编写一个执行垃圾收集的C函数:释放所有已分配的内存。


不可能,除非你先写一个完整的内存管理

包装,跟踪所有的分配和删除。

3.定义信号。


C没有任何名为信号量的东西。

4.什么是并行编程以及你将遇到什么样的问题面对这种程序?


C没有任何名为''并行编程''的东西。

如果有人给第一个和
第二个问题。




这四个与C

语言有关的唯一问题是第二个,我回答了。


-

Jack Klein

主页: http://JK-Technology.Com

常见问题解答

comp.lang.c < a rel =nofollowhref =http://www.eskimo.com/~scs/C-faq/top.htmltarget =_ blank> http://www.eskimo.com/~scs/C -faq / top.html

comp.lang.c ++ http://www.parashift.com/c++-faq-lite/

alt.comp.lang.learn.c-c ++
< a rel =nofollowhref =http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html\"target =_ blank> http://www.contrib.andrew。 cmu.edu/~a...FA Q-acllc.html


Matt写道:


我今天在接受采访时遇到了这些问题:

1.使用C定义一个类。
2.编写一个执行垃圾收集的C函数:释放所有分配的内存。
3.定义信号量。
4.什么是并行编程以及在这种编程中会遇到什么样的问题?

如果有人给出第一个答案,我会恭喜你。
第二个问题。




C没有课程。如果由你决定,你可以写:


#define class(1)


它是合法且可用的。这可能不是那个白痴面试官想要听到的东西,但是他没有白痴呢

本来就是他想要的。


#2在标准C中是不可能的。任何垃圾收集都会将
限制为可能分配的项目的子集。

承担请注意,重新定义malloc是不允许的,

realloc,免费。只有C系统实现者可以获得这些

的东西。


-

查克F(cb ***** ***@yahoo.com)(cb********@worldnet.att.net)

可用于咨询/临时嵌入式和系统。

< HTTP://cbfalconer.home.att.net>使用worldnet地址!




" Matt" <毫安******** @ hotmail.com>在消息中写道

新闻:f6 ************************* @ posting.google.co m ... < blockquote class =post_quotes>我今天在采访中遇到了这些问题:

1.使用C定义一个类。
2.编写一个执行垃圾收集的C函数:释放所有<分配回忆。
3.定义信号量。
4.什么是并行编程以及在这种编程中会遇到什么样的问题?

如果有人给出了第一个和第二个问题的答案,我会赞不绝口。

问候,
Matt




出于好奇...所以你对这些问题的答案是什么?

-

{Kelvin @ !!! }


I had these questions in an interview today:
1. Define a class using C.
2. Write a C functions that does garbage collection: frees all
allocated memories.
3. Define semaphore.
4. What is parallel programming and what kind of problems you will
face in this kind of programmings?
I will appriciate if someone gives some answers to the first and the
second questions.
Regards,
Matt

解决方案

On 25 Oct 2004 16:43:32 -0700, ma********@hotmail.com (Matt) wrote in
comp.lang.c:

I had these questions in an interview today:
1. Define a class using C.
C doesn''t have anything named a ''class''.
2. Write a C functions that does garbage collection: frees all
allocated memories.
Not possible, unless you first write a complete memory management
wrapper that tracks all allocations and deletions.
3. Define semaphore.
C doesn''t have anything named a ''semaphore''.
4. What is parallel programming and what kind of problems you will
face in this kind of programmings?
C doesn''t have anything named ''parallel programming''.
I will appriciate if someone gives some answers to the first and the
second questions.



The only question of the four that has anything to do with the C
language is the second, and I answered it.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html


Matt wrote:


I had these questions in an interview today:

1. Define a class using C.
2. Write a C functions that does garbage collection: frees all
allocated memories.
3. Define semaphore.
4. What is parallel programming and what kind of problems you will
face in this kind of programmings?

I will appriciate if someone gives some answers to the first and
the second questions.



C does not have classes. If it is up to you, you could write:

#define class (1)

and it would be legitimate and usable. It may not be what the
idiot interviewer wanted to hear, but it he has not an idiot it
would have been what he did want.

#2 is not possible in standard C. Any garbage collection would
have to be limited to a subset of the possible allocated items.
Bear in mind that it is not permissable to redefine malloc,
realloc, free. Only the C system implementor can get at these
things.

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!



"Matt" <ma********@hotmail.com> wrote in message
news:f6*************************@posting.google.co m...

I had these questions in an interview today:
1. Define a class using C.
2. Write a C functions that does garbage collection: frees all
allocated memories.
3. Define semaphore.
4. What is parallel programming and what kind of problems you will
face in this kind of programmings?
I will appriciate if someone gives some answers to the first and the
second questions.
Regards,
Matt



out of curiosity... so what''s your answers to these questiions??
--
{ Kelvin@!!! }


这篇关于一些面试问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆