Dear friends, I have one more questions for everyone in the newsgroup:
I am preparing for an interview on UNIX/C++. Could you please identify some
of the most important questions which might be asked, so that I could best
prepare for it?
Thank you,
C++J
Jul 22 '05
71 5945
I still don't understand why you've picked this question?
Just for the sake of the fancy term "POD", which you already know?
This question is definitely not the best single question about C++.
CFG wrote: I still don't understand why you've picked this question? Just for the sake of the fancy term "POD", which you already know?
This question is definitely not the best single question about C++.
As I said it would be one question of the many to determine the depth of
the candidate's knowledge. There would be simpler ones too. Since he
asked for a question that he could be asked, I chose to provide a
difficult one and not an easy one, that it would be certain he would
answer. And he learned new things, so why is it bad?
Regards,
Ioannis Vranos
cj wrote: Dear friends, I have one more questions for everyone in the newsgroup:
I am preparing for an interview on UNIX/C++. Could you please identify some of the most important questions which might be asked, so that I could best prepare for it?
Another interesting question that I would ask, in the advanced level
this one.
In a class hierarchy with virtual member functions, how much does the
time cost of calling a virtual function increases while the depth of
abstraction increases?
For example:
class base1
{
// ...
virtual void something();
};
class base2: public base1
{
// ...
void something();
};
//...
class base999999: public base999998
{
// ...
void something();
};
base1 *p1=new base78;
p1->something();
base1 *p2=new base999999;
p2->something();
How much more time it takes for the implementation to find and invoke
base999999::som ething() in comparison to base78::somethi ng()?
Regards,
Ioannis Vranos
"Ioannis Vranos" <iv*@guesswh.at .grad.com> skrev i en meddelelse
news:cb******** ***@ulysses.noc .ntua.gr... cj wrote: Dear friends, I have one more questions for everyone in the newsgroup:
I am preparing for an interview on UNIX/C++. Could you please identify
some of the most important questions which might be asked, so that I could
best prepare for it?
Thank you, C++J Here is one I would ask:
Is the following code guaranteed to be safe and portable? #include <string> #include <vector> #include <cstddef>
int main() { using namespace std;
class A { vector<int>arra y; string s;
public: A():array(100){ } }a;
unsigned char *p=reinterpret_ cast<unsigned char *>(&a);
unsigned char *v=new unsigned char[sizeof(a)];
for(size_t i=0; i<sizeof(a); ++i) v[i]=p[i]; }
I do believe that that question is a very bad one. The code above is
obviously portable, but these casts do confuse. What on earth are you going
to do with v? Any programmers instinct is that code must have "a use", and
it is quite difficult to see what you could portable do with v. Also, the
reinterpret_cas t is to a non-const pointer which chould also give all of us
an uneasy feeling. Don't do that against those poor could-be collegues!
Kind regards
Peter
"Ioannis Vranos" <iv*@guesswh.at .grad.com> skrev i en meddelelse
news:cb******** ***@ulysses.noc .ntua.gr... cj wrote:
Dear friends, I have one more questions for everyone in the newsgroup:
I am preparing for an interview on UNIX/C++. Could you please identify
some of the most important questions which might be asked, so that I could
best prepare for it?
Another interesting question that I would ask, in the advanced level this one.
In a class hierarchy with virtual member functions, how much does the time cost of calling a virtual function increases while the depth of abstraction increases?
[snip]
How much more time it takes for the implementation to find and invoke base999999::som ething() in comparison to base78::somethi ng()?
Regards,
Ioannis Vranos
That one was much better! ;-)
/Peter
Ioannis Vranos wrote: Another interesting question that I would ask in the advanced level is this one.
In a class hierarchy with virtual member functions, how much does the time cost of calling a virtual function increases while the depth of abstraction increases?
For example:
class base1 { // ...
public: virtual void something(void) ; };
class base2: public base1 { // ...
public: void something(); };
//...
class base999999: public base999998 { // ...
public: void something(); };
base1 *p1=new base78;
p1->something();
base1 *p2=new base999999;
p2->something();
How much more time it takes for the implementation to find and invoke base999999::som ething() in comparison to base78::somethi ng()?
It depends upon the implementation (compiler).
In the typical implementation, it takes no more time.
The C++ computer programming language standard
does *not* specify implementations , performance or efficiency.
E. Robert Tisdale wrote: How much more time it takes for the implementation to find and invoke base999999::som ething() in comparison to base78::somethi ng()?
It depends upon the implementation (compiler). In the typical implementation, it takes no more time. The C++ computer programming language standard does *not* specify implementations , performance or efficiency.
Wrong. Next please. :-)
Regards,
Ioannis Vranos
Ioannis Vranos wrote: E. Robert Tisdale wrote:
How much more time it takes for the implementation to find and invoke base999999::som ething() in comparison to base78::somethi ng()? It depends upon the implementation (compiler). In the typical implementation, it takes no more time. The C++ computer programming language standard does *not* specify implementations , performance or efficiency.
Wrong. Next please. :-)
But I forgot to give you a reference. "The C++ Programming Language" 3rd
Edition or Special Edition, page 324.
Regards,
Ioannis Vranos
Peter Koch Larsen posted: I do believe that that question is a very bad one. The code above is obviously portable, but these casts do confuse. What on earth are you going to do with v? Any programmers instinct is that code must have "a use", and it is quite difficult to see what you could portable do with v.
What ever happened to just having fun?
int main(void)
{
int monkeys[7] = { 3, 4 ,3, 2 ,2 ,34, 23 ,3 };
char jack reinterpret_cas t<char>(monkey s[5]);
cout << jack;
}
JKop posted: Peter Koch Larsen posted:
I do believe that that question is a very bad one. The code above is obviously portable, but these casts do confuse. What on earth are you going to do with v? Any programmers instinct is that code must have "a use", and it is quite difficult to see what you could portable do with v. What ever happened to just having fun?
int main(void) { int monkeys[7] = { 3, 4 ,3, 2 ,2 ,34, 23 ,3 };
char jack reinterpret_cas t<char>(monkey s[5]);
TYPO
char jack = reinterpret_cas <char>(monkey s[5]); cout << jack; } This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: softwareengineer2006 |
last post by:
All Interview Questions And Answers
10000 Interview Questions And Answers(C,C++,JAVA,DOTNET,Oracle,SAP)
I have listed over 10000 interview questions asked
in interview/placement test papers for all companies between year
2000-2005
in my website
http://www.geocities.com/allinterviewquestion/
So please have a look and make use of it.
|
by: Jobs |
last post by:
Download the JAVA , .NET and SQL Server interview sheet and rate
yourself. This will help you judge yourself are you really worth of
attending interviews. If you own a company best way to judge if the
candidate is worth of it.
http://www.questpond.com/InterviewRatingSheet.zip
2000 Interview questions of .NET , JAVA and SQL Server Interview
questions (worth downloading it)
|
by: Jobs |
last post by:
Download the JAVA , .NET and SQL Server interview with answers
Download the JAVA , .NET and SQL Server interview sheet and rate
yourself. This will help you judge yourself are you really worth of
attending interviews. If you own a company best way to judge if the
candidate is worth of it.
http://www.questpond.com/InterviewRatingSheet.zip
|
by: connectrajesh |
last post by:
INTERVIEWINFO.NET
http://www.interviewinfo.net
FREE WEB SITE AND SERVICE FOR JOB SEEKERS /FRESH GRADUATES
NO ADVERTISEMENT
|
by: freepdfforjobs |
last post by:
Full eBook with 4000 C#, JAVA,.NET and SQL Server Interview questions
http://www.questpond.com/SampleInterviewQuestionBook.zip
Download the JAVA , .NET and SQL Server interview sheet and rate
yourself. This will help you judge yourself are you really worth of
attending interviews. If you own a company best way to judge if the
candidate is worth of it.
http://www.questpond.com/InterviewRatingSheet.zip
| |
by: freesoftwarepdfs |
last post by:
Ultimate list of Interview question website.....Do not miss it
http://www.questpond.com
http://msdotnetsupport.blogspot.com/2007/01/net-interview-questions-by-dutt-part-2.html
http://msdotnetsupport.blogspot.com/2006/08/net-windows-forms-interview-questions.html
http://msdotnetsupport.blogspot.com/2006/08/net-remoting-interview-questions.html
http://msdotnetsupport.blogspot.com/2006/08/c-interview-questions.html...
|
by: ramu |
last post by:
C# Interview Questions and Answers8
http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html
C# Interview Questions and Answers7
http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers7.html
C# Interview Questions and Answers 6
http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers-6.html
C# Interview Questions and Answers 5...
|
by: reema |
last post by:
EJB Interview Questions
http://interviewdoor.com/technical/EJB-Interview-Questions.htm
CSS Interview Questions
http://interviewdoor.com/technical/CSS-Interview-Questions.htm
C Interview Questions
http://interviewdoor.com/technical/C-Interview-Questions.htm
C# Interview Questions
http://interviewdoor.com/technical/C-sharp-Interview-Questions.htm
C++ Interview Questions
http://interviewdoor.com/technical/C++-Interview-Questions.htm
|
by: reema |
last post by:
EJB Interview Questions
http://interviewdoor.com/technical/EJB-Interview-Questions.htm
CSS Interview Questions
http://interviewdoor.com/technical/CSS-Interview-Questions.htm
C Interview Questions
http://interviewdoor.com/technical/C-Interview-Questions.htm
C# Interview Questions
http://interviewdoor.com/technical/C-sharp-Interview-Questions.htm
C++ Interview Questions
http://interviewdoor.com/technical/C++-Interview-Questions.htm
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |