CHAPTER 7

images

Optimization

Interviewers usually expect efficient solutions that solve problems within the resource constraints, so it is important for candidates to improve code performance from the perspectives of both time and space consumption. This chapter illustrates strategies to optimize programs by selecting appropriate data structures and algorithms, as well as by making trade-off decisions to balance time and space efficiencies.

Time Efficiency

No one likes to wait for a delayed response from a software application, so companies spend a lot of resources on performance optimization before software releases. That is why many interviewers ...

Get Coding Interviews: Questions, Analysis & Solutions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.