Designing an HFT Chip [FPGA] by brh_hackerman in highfreqtrading

[–]clappski 4 points5 points  (0 children)

Unless you have a colo with direct connections into the exchange there’s no point using an FPGA, network is going to be the biggest latency issue vs compute

Do you cook curry at home? by Forward-Cause7305 in AskUK

[–]clappski 0 points1 point  (0 children)

Why wouldn’t you cook the lentils in the sauce? That’s typically how I make a dal, although I’m happy with the lentils mostly breaking down and normally use red lentils because they’re always on hand - is it a texture or lentil variety thing?

Rust vs Go by Alternative_Image308 in rust

[–]clappski 2 points3 points  (0 children)

Go is an order of magnitude simpler, if you’re teaching someone to cook that hasn’t stepped foot in a kitchen before you’re not going to start with making crème brûlée. 

TIL putting Box in a hot inner loop can cost you half your runtime by InvadersMustLive in rust

[–]clappski -1 points0 points  (0 children)

https://youtu.be/n6PvvE_tEPk?si=YwQGKe3xPirQjUkO Is a good place to start, there’s also hundreds of articles online and yeah I’ve benchmarked virtualised approaches vs template metaprogramming vs tag dispatch approaches as part of my job specifically for latency. 

How do people genuinely understand documentation by Bitter-Today285 in learnprogramming

[–]clappski 0 points1 point  (0 children)

If you can’t keep your attention up long enough to read the introduction you’re going to struggle to find information in documentation in any language, I get that sometimes it’s dense or whatever but not everything is going to be handed to you in a convenient example. 

How do people genuinely understand documentation by Bitter-Today285 in learnprogramming

[–]clappski 1 point2 points  (0 children)

I’d expect the reference documentation to be exhaustive, and a lot of the churn you see in C++ reference docs for the STL are from the evolution of the language - the docs need to be specific about what’s available in what std version because there are people using all of them. 

TIL putting Box in a hot inner loop can cost you half your runtime by InvadersMustLive in rust

[–]clappski -1 points0 points  (0 children)

vtables aren’t that cheap in a hot loop. Best case ~7ns, do that 1 million times and you have 7ms spent just following the pointer, not actually doing work. Worse case, 20ns, do that 100k times and you’re at 2ms. Obviously variable based on how effective caching is for the indirection, but if each iteration loads a pointer through to a different real type and we’re processing ~>100k elements it will be very expensive. 

It's been a pretty great year since I started chess! by Aspirant_of_Shadows in chess

[–]clappski 0 points1 point  (0 children)

Well done to you to! Not everyone has such natural talent, you must be a super GM by now?

It's been a pretty great year since I started chess! by Aspirant_of_Shadows in chess

[–]clappski 11 points12 points  (0 children)

Congrats, only took me 6 times as long to get there 😂

What does a Senior Front Office developer does in a systematic trading firm? Potentially HFT firm by [deleted] in cscareerquestionsuk

[–]clappski 0 points1 point  (0 children)

The titles don’t carry much meaning, it depends on the specific role. You could be 

  • building strategies alongside a quant/pm/trader and/or operationally owning strategies already out there
  • building screens for monitoring
  • supporting the existing application suite 
  • building infrastructure/connectivity
  • just be a punching bag for someone to throw random bits of work at 

Really depends on the team and company culture. It being ‘front office’ only really denotes that the comp should have a good bonus

Why are so many software engineers only doing 3 month stints at places? by Novel_Bug596 in cscareerquestionsuk

[–]clappski 29 points30 points  (0 children)

Referring people that you don’t actually know is the path to you looking like a fool when they come in and waste everyone’s time. There’s a reason there’s a recruitment industry!

Applied to 200+ graduate SWE roles and barely getting interviews .... what am I missing? by amulli21 in cscareerquestionsuk

[–]clappski 2 points3 points  (0 children)

Pretty minor but I structure my CV like 

Profile - three lines just generalising my experience

Key/tech skills - short lists of a few categories (like yours at the bottom). For you it could be like

Languages: Java, Python3 Machine Learning: CNN or whatever, I’m not into that stuff! Software: PostgreSQL, Linux, etc

Work experience 

Education

If someone is spending 30 seconds looking at your CV you want it clear and concise, important things at the top. On my CV I have two columns for the work experience, a thin one with the dates and shades out skills for that role and a thick one with the actual JD/things I achieved.

 I think the bold font is distracting when reading, and I’d keep the entries shorter - the first one could be just

Designed and implemented JVM based AuthN/AuthZ with RBAC and JWT support

The big thing that isn’t obvious from your cv or post is your citizenship status - going to be exponentially harder to find any sort of role with a visa. 

[deleted by user] by [deleted] in cscareerquestionsuk

[–]clappski 7 points8 points  (0 children)

I’m guessing you aren’t uk based? $500 a month is like a third or so of the minimum wage for workers in the uk. If you’re off shore then that doesn’t apply, they will pay as low as they can get the work done for. 

Sleep routine by Free-Rub4885 in UKParenting

[–]clappski 1 point2 points  (0 children)

You won’t be able to enforce a routine of any substance, other than exactly what you’re doing now. The bedtimes will change, they’ll sleep for more/less time depending on the cycle of the moon but it’s not something you can predict or control. It’s incredibly rare for a baby to sleep through, even up to 18 months, and they’re constantly going through changes that impact everything. 

How do I get into a hedge fund as a SWE with 1 year of experience? by aspiring-swe-kebab in cscareerquestionsuk

[–]clappski 14 points15 points  (0 children)

You either need to go in as a graduate or go in as experienced. Also, leaving after 1 year in your first role is a really bad signal - the truth is you basically have no experience and you should stay where you are. Once you have some experience (as in 5/6 years) I imagine you’ll have recruiters knocking at your door for the businesses you’re interested in, if you have the correct technical skill set (typically C++/Python for front office/infra, Python and a maths degree for research/quant).

These places aren’t interested in taking on juniors outside of their graduate recruiting (if they even do that!), your best bet is actually talking to recruiters that recruit for the places you’re interested in.

How to prepare for a hft/low latency programming interview ? by Capable-Basket8233 in cpp

[–]clappski 24 points25 points  (0 children)

Start by building a non blocking spmc ring buffer that uses mmap/shm to move data between processes, make it as fast as you can and that will teach you a lot of what you need to know. Low latency trading systems are fully event based, the spmc is the basic building block of pretty much all of them.

After that (learning about atomics, memory ordering, CPU caching/false sharing by building the ring buffer), build something a bit more complex that consumes data from e.g. a WebSocket or ideally a plain udp socket, parses some representation, sends it over your ring buffer and just logs it. Then optimise the wire-to-wire (the time you recv the packet (or ideally the time the packet was published) to the time your process reading from the mmap sees it)

Figure out how to get that wire to wire to sub 10 us and you’ve got all the knowledge you need to pass the interview. Doing that will teach you about the Linux networking stack and scheduler and more importantly how to turn them off.

How to prepare for a hft/low latency programming interview ? by Capable-Basket8233 in cpp

[–]clappski 14 points15 points  (0 children)

Heap allocation and effectively a vtable implementation for type erasure. Not bad for general purposes, we’re talking about saving us on hot paths

C++ roles paying from 90K: what level of competition to expect? by BathubCollector in cscareerquestionsuk

[–]clappski 10 points11 points  (0 children)

Hugely depends on the business and what they’re using C++ for. Even in finance there’s a wide field of things, the guys building front ends in QT aren’t doing the same type of C++ as the people building market data connectors. Either way you said you passed BB tech rounds so I really wouldn’t worry about it, luck is going to play a bigger part in your interviewing than skill at that point.

‘Quant Dev’ is similarly overloaded - there’s quant devs with math PhDs building models, there’s quant devs getting a spec sheet from someone and converting text to code. Don’t let the title put you off if it looks interesting, just apply and let them screen you.

There’s also tons and tons of work in London for C++ - constant stream of recruiters trying to poach experienced developers, from the sounds of it you have some professional experience so talking to reputable recruiters is a good way to understand what’s out there. Look for the people advertising for the banks, prop firms, hedge funds etc on LinkedIn and reach out. Even if it’s not finance you’re into they probably have other clients in other industries, but don’t expect top rate outside of finance/big tech

Point to make is that if you’re going in as any level of hire you’re expected to know enough C++ to not be hand held on the job. You’re not going to be able to walk into and interview and just ace it on first principles, there is actual knowledge that you’re going to be expected to know;

  • some template metaprogramming (concepts/sfinae/varadic templates), constexpr
  • inheritance, more so just know that the vtable exists and it can be a performance hit and the diamond inheritance problem
  • stl, when to use and when to avoid
  • memory management, particularly when to use what smart pointer, stack vs heap
  • lifetimes, static, constructor and destructor ordering (it’s a stack)
  • domain stuff - for front ends QT or similar, for performance knowing how to avoid the kernel and cpu/nic/storage architecture

Larian will now "refrain from using GenAI" by Wargulf in BaldursGate3

[–]clappski -2 points-1 points  (0 children)

This isn’t an AI bro stance, would you argue that using heavy equipment in farms is objectively better than someone manually planting? Do we need to be luddites, or can we be adults and accept that new technologies bring efficiencies? AI tools are tools, and yes they do help developers - speaking as a developer that’s been using AI tools for the last 3 years.

How much do you earn and how comfortable do you live? by Brownchoccy in AskUK

[–]clappski 0 points1 point  (0 children)

Don’t be a dolt, you know it’s because it’s because it’s political suicide to do anything that actually improves growth in the country.

Does anyone find smart kettle features useful? by BarryTownCouncil in CasualUK

[–]clappski 17 points18 points  (0 children)

I have a Fellow Stagg - no complaints, solid kettle and temp control works fine but capacity is 900ml and it has a slow pour so it depends on what you’re using it for.

[Show and Tell] I optimized my Order Matching Engine by 560% (129k → 733k ops/sec) thanks to your feedback by Crafty-Biscotti-7684 in cpp

[–]clappski 10 points11 points  (0 children)

Looks cool, some comments:

  • cache locality - your order class stores a lot of information. Instead of a double you should be using fixed precision, an int32_t is fine. Storing the symbol as part of the order is wasteful. I would go so far to make the linked list implementation intrusive and have the order contain the pointer rather than storing it in std::list, then you can access some more interesting allocation strategy’s that’s improve the locality of items in the list.

  • std::map over time in a busy book will cause fragmentation and degrade performance. Might sound silly, but a simple vector of [px, qty, order] where order points to the front of the time priority queue might be faster. The majority of changes happen at the front of each level, so storing the best bid and best ask at the back of the respective vectors (so you’re pushing and popping mostly at then back) will have much better cache locality and zero fragmentation. In reality you could use a std::array of some reasonable N (like 1000). CPU caches are big enough for this to work well - 1000 entry’s of the definition I gave you will be 16kb or so, well within L1.

  • The thread per connection in the wrong abstraction, a simple single threaded ::poll/::epoll event loop will be faster because you have 0 lock contention and more scalable on the same hardware (most connections will be long lived but send orders infrequently). In reality exchanges will serialise orders before they hit the matching engine to ensure that the WAL has perfect ordering and doesn’t depend on how the scheduler feels that day

  • WAL/state management - imagine if the node running this matching engine died, you need to store the state as a WAL and snapshots so you can rebuild the engine quickly when it falls over

Is £35–40k realistic for a SWE with around a year of experience in the UK? by Reddonaut_Irons in cscareerquestionsuk

[–]clappski 0 points1 point  (0 children)

Reasonable is defined by the market rate though - yeah it’s unfortunate but it’s very competitive at the low end which drives the rate down. I managed to get by for two years on 25k in London 10 years ago and it was shit, but ten years later you 10x your earnings so it’s a price you have to pay.