TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Three ways to improve your InterviewStreet CodeSprint solution

10 pointsby ovechtrickover 13 years ago

2 comments

saryantover 13 years ago
Indeed. I have to say I'm rather embarrassed that I have yet to get a solution to pass every test case due to the time limit.<p>I've enjoyed the problems nonetheless. If nothing else it's been a good excuse to learn some features of a few languages that I haven't used yet.<p>While I don't expect anything to come of this employment-wise (and yes, I am looking) I'm glad to have participated.
Drbbleover 13 years ago
Is printing really so slow and unbuffered, and output so voluminous, that output is really hotspot? The advice is completely opposite from real world best practices. You should print as soon as you have any output, so that your consumer can process output in a concurrent pipeline, and use a lower-level (concurrent!) buffer to batch output in an environment-appropriate batch size, for TCP or disk or whatever is underneath your app.<p>The other points, about using an efficient algorithm instead of a merely correct one that assumes unreasonably large resources, are more on target.<p>Before coding any algorithm, always plug in the problem size bounds to your O() function estimate. In these contests there is usually one obvious large number that tells you where your algorithm needs to be sub-quadratic