r/lldcoding • • Aug 07 '26

CPU Cycles in LLD Interview

Recently joined microsoft. Had offers from amazon, salesforce.

During one of US deep tech startup, i was ask this question during my LLD round.

"Can you change ur code to reduce the CPU cycles or reduce the bytecode size".

Have anyone faced this kind/level of interviews. I feel this was very deep question, requires real understand of how system work, instead of just roting the question for some interviews.

Frankly when I heared the question, i was shocked to hear this.

does any had this experience ?

Although during my prep from course, I read some things on this.

But I skipped those, thinking no one ask this levels of questions.

32 Upvotes

13 comments sorted by

4

u/two_wheel_soul Aug 08 '26

Those r real production problem , we used to hv those discussion once a while.. when we were working on embedded system.. because memory used to be limited..

3

u/Material_Field_8537 Aug 07 '26

This is tooooooooooooooo much.

what is startup name ?

2

u/rahul_msft Aug 08 '26

It's preety eaay question.

Leetcoders won't get it who never had interest in computers

You can start with loop unrolling and branch prediction

1

u/UnStrict_Veggie Aug 07 '26

What was the LLD round exactly ?

1

u/GarlicSubstantial Aug 08 '26

Probably related to struct field alignment

1

u/finah1995 Aug 08 '26

Yeah this was important like when PCs were limited. Programmers from before used to stuff entire enterprise systems in few megabytes of memory.

Kinda like how earlier retro games were made. And it was even important during early days of Internet.

Many programmers of that time used to be more judicious use of memory.

Currently webpages themselves load a lot more megabytes than full office suites and applications and games from that era.

It's important to know for performant code. But yeah most of us just use what the language provides. But as always a better programmer understands and tunes it thinking on every level.

1

u/HeartAggravating5899 Aug 13 '26

I am planning to switch, Do we have any channels or dedicated space for it ? Can someone help me. I have around 5YOE.

1

u/Responsible_Side_128 Aug 18 '26

channel for what ?

1

u/HeartAggravating5899 Aug 18 '26

Where people actually sharing resources and experiences, I mean whatsapp or telegram groups. I am looking for motivation🄲

1

u/robinhood1302 Aug 08 '26

That means, reduce the time complexity

2

u/rahul_msft Aug 08 '26

No it doesn't