MAQ Interview Question for Applications Developers


Country: India
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
1
of 1 vote

In SQL Server,

BEGIN TRY
    BEGIN TRANSACTION TransacName
    -- do stuff
    COMMIT TRANSACTION TransacName
END TRY

BEGIN CATCH
    -- if there were errors, roll back
    ROLLBACK TRANSACTION TransacName;
    -- rethrow exception, write to log, and do whatever else
END CATCH

- Anonymous August 29, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

i did talk about transactions commit and rollback and even about check points and those stuff but the lady was not convinced either she wanted me to talk about those log based methods or shadow copy and those stuff dont kno xactly

- Moiz Arsiwala August 30, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I don't know what to tell you. In situations like this, my advice would be to ask the interviewer what requirements they have that aren't being met by the current solution. What's the business problem, and in what way is it not being solved by the current solution?

- eugene.yarovoi August 30, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

She wanted to know about versioned writes, where each process makes its own copy of the shared data known as shadow copy, adds a version [timestamp etc] to it and makes changes to the copy only. In case of multiple process writes, it's not the database's / admin's responsibility to maintain consistency but the updating library's. Read Amazon's Dynamo File system. And this for basic concept : edndoc.esri.com/arcsde/9.1/general_topics/what_versioned_dbase.htm

- YetAgain February 24, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Also for distributed systems, we can talk about 2 Phase Commit Protocol for Atomic Transactions

- YetAgain February 24, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Use of transactions. Either everything happens or nothing happens

- axecapone August 29, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think the question is more in terms of how do you make your DB thread safe. There are various methods and their respective trade offs. For e.g. In mysql, MyISAM storage engine does a table level locking, advantage, fetching the lock information is very trivial but it comes at a very big performance penalty. Only one thread at a time can use the table.

Compared to that, InnoDB provides row level locking but if there are million rows in your table what do you do. Preallocate millions of locks? The advantage is improved performance.

In general this question will drift towards the readers writers problem.

- siucuse November 13, 2012 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More