What skills for C/C++ High Frequency Trading
Mar 31, 2019
10 Comments
What skills should I develop to apply successfully for core HFT trading companies. Besides leetcoding. If you answer networking, be more specific
What skills should I develop to apply successfully for core HFT trading companies. Besides leetcoding. If you answer networking, be more specific
comments
Computer Architecture- Pipelining, cache coherence, branching, vectorization.
C++ - metaprogramming with templates and constexpr, CRTP to allow static polymorphism instead of dynamic, reducing virtual functions so that vtable lookups are reduced, RVO/NRVO, move semantics, reduced if statements to reduce branching and jumps, expression templates, placement new and using preallocated memory pools to avoid constantly using the memory allocator, cache friendly code using performant STL containers like vector over non performing ones like map, unordered map, avoid shared_ptr since reference counting is an expensive operation and use unique_ptr only when needed, reduce use of C++ exceptions.
Userspace level in Linux you should know non blocking I/O , Interprocess Communication, shared memory.
Resources-
1) Linux Kernel Development, Robert Love
2) Linux Programming Interface, Michael Kerrisk
3) Understanding Linux Network Internals, Christian Benvenuti
4) Richard Stevens TCP/IP books as a reference since it is 3 volumes.
5) C++ Templates 2nd Edition by David Vandervoode,
6) C++ Concurrency in Action 2nd Edition by Anthony Williams
7) Modern Effective C++ by Scott Meyers
8) Andrei Alexandrescu’s C++ book
9) r/cpp on Reddit
10) Sergey Zubkov’s answers on Quora
11) Computer Systems, A Programmers Perspective, 3rd edition. Chapters 4,5,6,8,9 are important.
12) Agner Fog’s C++ Optimization guide, freely available on his website.
But if you really want to start trying to code close to bare metal. Reddit has some good discussions around this.
Also a lot of work is in OpenMPI and OpenCL and you know your hardware and its instruction set that you will program to and the cache coherence when accessing memory. If NUMA means a clothing brand to you then you won’t like it.
more low-latency optimizations closer to the metal: OS, hardware, networking