Tomzik's blog

By Tomzik, history, 7 years ago, In English

Hello everyone,

When writing algorithms operating on sequences, we need to be precise with how we deal with bounds.

For instance, in C, we usually write loops such as:

  for (i = 0; i < n; i++) { ... }   // exclusive bound

But in other language, we'd write.

   for i = 0 to n - 1   // inclusive bound

Similarly, let say we write a binary search function binary_search(arr, i, j), we need to to decide whether j is included or not.

How do you decide which version to use? Do you try to be consistent or do you decide depending on the problem?

Full text and comments »

  • Vote: I like it
  • +18
  • Vote: I do not like it

By Tomzik, history, 7 years ago, In English

Has anyone here done interviews with Facebook? I know they ask applicants to solve algorithmic problems, how do their problems compare with the ones of codeforces? what type of difficulty to expect? Do you think codeforce is a good training resource or should I look somewhere else?

Thanks!

Full text and comments »

  • Vote: I like it
  • +26
  • Vote: I do not like it

By Tomzik, history, 7 years ago, In English

Finally, I'm blue! I'm looking for advice to keep improving.

I can solve consistently problems A and B, and most of the time C. However, I usually have little time left to address problem D.

I've been working on more difficult problems and algorithms, but I never get to try them in contests as I'm not able to solve A, B, C fast enough. What do you think is a good strategy to improve? should I try to be more fast on the first problems, or should I force myself to work on problem D in the contests?

Full text and comments »

  • Vote: I like it
  • +17
  • Vote: I do not like it