%%c++IV weaker cf java#2017introspection

https://bintanvictor.wordpress.com/2017/04/02/c-and-java-iv-tend-to-beat-us-in-2-ways-high-end/ shows my self-rating in job interviews for c++ vs java. (For real projects, I think the gap between my c++ and java is slightly smaller.)

I did spend lots of time reading and blogging about c++, not less than java, so

Q: why the persistent gap in my QQ IV performance?

  • –A #1: biggest reason — I feel a disproportionate number of my c++ interviews come from high end teams, They go slightly more low-level than my java interviews. Imagine if I get more high end java interviews from the likes of Millennium, HSBC … I feel most (like 80%) of the java jobs in finance are “regular”; for c++, it’s below 50%. See the post on the c++ job offers I received.
    • If I avoid the high-end jobs, then my batting average will probably increase significantly.
  • –A #3: [QQ] significantly simpler in terms of QQ — java as a language, when we ignore the add-on packages.
  • –A #2: [QQ] Some of these interviewers basically treat c++ as a wrapper over C. In contrast, Java insulates you in a pure-java world on the Virtual Machine, so you don’t need to deal with the messy “borders” as c# and c++ developers do. A lot of the tough C++ IV questions are about
    • linux,
    • [C] sockets,
    • [C] *alloc function, memory leak detectors
    • [C] IPC
    • [C] other command line developer tools … mostly designed for the “system programmer”.
  • –A: [QQ] STL containers — is much more complicated than java containers in job interviews, even if we ignore iterators, stl algorithms.
    • I spent more time studying STL than java collections but always failed to impress interviewers.
    • eg: in java container of T is always implicitly container of well-managed pointer  to T
  • –A: [QQ] halos — in my “java show” include threading, collections, GC tuning … which make up for my weaknesses. No such halo in my “c++ show” I guess some people have a halo in templates, memory mgmt, shared_ptr, threading…
  • –A: unable to describe c++ projects.
  • Suggestion: Start from this blog and my books. Focus on a small subset of core topics in c++, /burn through/ the essential literature and develop a first halo —
    1. smart pointers (beyond shared_ptr)
      1. usage in big5
      2. usage in containers
    2. data structures in STL and boost, including c-str life-cycle management excluding the str* functions
    3. traditional big 3(dtor,op=, copier) but not rvr and move-semantic
    4. pbclone^pbref but not return-value-optimization
    5. const
    6. vptr, slicing, dynamic_cast
  • (Note this is all about QQ book knowledge, not coding skill!)
  • suggestion: secondary focus topics —
    1. c++11 threading
    2. heap memory management;
    3. socket tweaking;
    4. interface classes, pure virtual;
    5. design patterns
  • suggestion: continue to ignore some of the high complexity low leverage topics such as move semantics; iterators; const-correctedness; singleton; design patterns; operator overload … and many [[effC++]] topics

##10 basic programm`constructs for c++ cod`IV

See EPI300

  1. std::string (more useful than cStr)
  2. vector (more useful than array) sorted data structure (i.e. stl map), unordered_map
  3. Node class used in a linked graph
  4. dtor, copier, op=
  5. ref only as function I/O
  6. iterator – basic usage
  7. double pointer
  8. stack, queue
  9. pointer arithmetic
  10. shared_ptr
  11. local static

no exception
stl algo? Only Citadel array-shrink
no pointer to function
no template
no (very, very seldom) threading in coding Q
adv: matrix
adv: circular buffer


2017%%c++IV=B- i.e 6 #java=8

Looking at my blog posts, I did accumulate quite a lot of valuable knowledge, some of them useful to projects, most of them important to QnA interviews.

I would venture to say that even a 5Y c++ veteran may not know these very well. The 4 categories are defined in https://bintanvictor.wordpress.com/2017/04/02/c-and-java-iv-tend-to-beat-us-in-2-ways-high-end/:

  • pseudo code algo? they would score LOWER than me
  • QQ (mostly theoretical)? they have NO advantage over me.
  • edit-compile-test type of short coding test? they would score higher than me
  • BP i.e. knowledge gap revealed in coding tests is my weakest? they would score B.

See https://bintanvictor.wordpress.com/2017/02/12/c-real-jobs-offers-i-got/

boost(GTD+)muscle-building,without a firm ground

I wanted to know more about  boost lib to impress interviewers.

Some of the most useful boost data structures require a deeper understanding or work experience with STL than I have.

Some boost libraries require deeper understanding of other c++ features than I have:

  • references
  • casts
  • copyable

So without a firm ground, I find myself reading but not remembering. The mud doesn’t stick on the wall.

## c++topics seldom quizzed

(master -> pearl)
some low-level details I thought would be popular but seldom asked:
* L-value
* iterator types and implementations
* static variables outside classes
* implicit acts of magic by compiler
* array and cStr – syntax, memory, … the gory details beyond the basics
* template specialization
* ref/pointer typedef inside  templates
* non-dummy-type args in template
* MI
* enum
* exception spec
* C integration
* pimp
* fwd declaration
* namespace
* linker
* extern
* double pointers
* hiding rule
* swap – all the important usages and no-fail
* overloading and  method resolution
* casting and conversion
*** OOC and  conversion ctor
— “mid-level”
* boost Any vs Variant
* i/o stream
* regex
* file access (including random)
* serialization
* memory leak detection
* details of boost thread
* boost smart pointer beyond the shared_ptr
* std::string details

##c++(GTD+)learning-aids to upgrade 5-}6

Which yardstick? First must be IV. 2nd would be common (not the obscure) GTD skills
For IV, need to analyze how I was beaten in past interviews. For GTD zbs, a few major home projects has significantly increased my proficiency.
  • see recoll -> c++Q&A.txt
  • [ZZ] try out debug tools in the gdb book? LG
  • [ZZ] experiment with sample code in [[fin instrument pricing using c++]]
  • [ZZ] proj: valgrind (linux) – get hands-on experience. Might take too much time to get it working
  • problem – test if a linked list has cycles
  • problem: all permutations of 0 or more of abcde
  • problem: write skeleton c++ code for ref counted string or auto_ptr
  • problem: test if a given container is in ascending order
  • [ZZ means … see https://bintanvictor.wordpress.com/2017/02/14/low-leverage-ctopics/]

some benefits of learning c++, even if no salary increase

1) After learning c++, i am fairly confident I could if I must pick up

c# in a few (4?) months and start passing interviews. C++ is

inherently tougher than java and C#. Java and C# both have large

libraries, but the core languages are significantly simpler/cleaner

than c++.

2) After learning C++, i have found python and perl easier to

understand and master since both are written in C/C++. I now believe

some people who claim they could pick up a new language in a few

months. Those languages have their roots in C/C++.

– The basic challenges of scope+namespace, object lifetime,

heap/stack, pointers, memory allocation, object construction,

pass-by-ref/value, arrays, function pointer, exceptions, nested

struct+array+pointer… are faced by every language designer. Many of

these challenges depend on basic library, which is invariably C.

– The common OO challenges of inheritance, virtual, static/non-static,

HAS-A/IS-A, constructor, downcast, … are faced by every OO language

designer. Many of them borrow from java, which borrows from C++ and


3) c++ gave me insight into java, esp. GC, JVM, overriding,

references, heap/stack, sizeof, …

(2015)where in c++am I growing – GTD^IV

Short and sharp answers preferred
Q: where and how fast am I growing in c++ IV?
A: EPI300/Google style coding test, esp with STL, shared_ptr etc
A: the HFT interviews revealed my weaknesses in some areas.
Q: where and how fast am I growing in c++ zbs
A: [[safe c++]]
A: [[21st century C]]
A: Learnt to question what low level details are more than academic
A: Learnt the practical value of c++ integration with excel, python etc
A: Learnt a bit more about instrumentation including debuggers, esp. on Windows
A: Learnt a bit more about boost smart pointers. There are many of them, because there exists different needs.
A: Learnt a bit more about IDE
A: make, cmake and friends