KEY NOT FOUND: coverImgAlt
Logo
See All Photos

Two Sigma

Engaged Employer

Two Sigma

Add an Interview

Interview Question

Database Administrator Interview

-New York, NY

Two Sigma

Write an efficient stored procedure to allocate unique integer ids.

Tags:sql
AnswerAdd Tags

Interview Answer

1 Answer

0

CREATEPROCEDURE [dbo].[AllocateUniqueIntIds] AS BEGIN SelectABS(CAST(CAST(NEWID()ASVARBINARY(5))ASBigint))as UniqueIntegerId END Go /* Test the store proc */ Exec [dbo].[AllocateUniqueIntIds] //Not sure if this is the correct answer

Anonymous on

Add Answers or Comments

To comment on this, Sign In or Sign Up.

Two Sigma Careers

Cover image for Two Sigma

We bring science to finance. At Two Sigma, we follow principles rooted in technology and data science as much as those found in financial...More

  • Community
  • Working Together
  • What Drives Us
This is the employer's chance to tell you why you should work for them. The information provided is from their perspective.