Skip to main content
10 votes

Simple Key Value Database using C

mutex serves no purpose. It is not shared between processes, and your program is not multithreaded. If you want an exclusion between unrelated instances of the ...
vnp's user avatar
  • 56.5k
10 votes

Simple Key Value Database using C

Enable more compiler warnings: Adding: ...
Harith's user avatar
  • 8,906
8 votes

A thread-safe performant URL Shortener in Java

Thread-safety of addUrl() Method computeIfAbsent() is guaranteed to be executed as an atomic action when invoked on a ...
Alexander Ivanchenko's user avatar
7 votes
Accepted

Create an address self-complete bar

A few things you can improve: Use const instead var Don't use any as type Move ...
m.rufca's user avatar
  • 208
6 votes

A thread-safe performant URL Shortener in Java

The concurrency looks okay to me, given that the compute() calls lock urlToKey and keyToUrl (...
Toby Speight's user avatar
5 votes

Caches implementation in C++

I realise this is an old post, but one thing jumps out at me looking at the implementation: How does your Get( ) method prevent the cached value being destroyed ...
Kevmeister68's user avatar
4 votes

Simple Key Value Database using C

Review .h include needs Do not rely on other code to include the files for a given .c, .h file. set.h needs <stdio.h> for <...
chux - Reinstate Monica's user avatar
4 votes

Leetcode - First Unique Character in a String

Pay attention to Constraints While cracking algorithmic problems, pay very close attention to the constraints of the problem at hand. They can often give valuable clues on how to attack the problem. ...
Alexander Ivanchenko's user avatar
4 votes
Accepted

String character changes (case insensitive) - Go

A few comments. Simple is good. strchange.go: ...
peterSO's user avatar
  • 3,531
4 votes
Accepted

Last Stone Weight Problem in Haskell using list `insert`

Our first question should be "why is it O(N^2)?" The sort seems to be a merge-sort; I trust that it's O(n log(n)). But ...
ShapeOfMatter's user avatar
3 votes

Simple Key Value Database using C

Seems you are looping through index to get to your key position...at this point id suggest looking at hashtables/dictionaries, since this is what first comes to mind when talking about key-value data ...
Perdi Estaquel's user avatar
2 votes

Extracting records from a 2D List of strings

Some note I think the interview would be looking for Error Handling What if the inside list count is not equal to 4? Do you throw an exception, if so what one, or do you just ignore the record? I ...
CharlesNRice's user avatar
  • 4,408
2 votes

Simple Curry function

You can annotate this in the following way: ...
Фарид Ахмедов's user avatar
1 vote

Extracting records from a 2D List of strings

Main Collection population Your records collection's population could be written in a more concise way ...
Peter Csala's user avatar
  • 9,279
1 vote

Extracting records from a 2D List of strings

I would build something along the lines of this. Make a class that represents the record. ...
Bas Visscher's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible