Arista Networks Interview Question
Software EngineersCountry: India
Interview Type: Written Test
is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
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.
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.
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.
Interesting question.
- Anthony Mai January 17, 2016Normally you declare a static array like this:
const int m = 10, n = 12;
int ar[m][n];
But that would not take malloc-ed memory. To take malloc-ed memory you have to have a pointer type. It can be done like this:
const int m=10, n=12;
int (*ar)[m][n] = (int(*)[m][n]) malloc(sizeof(*ar));
//Access elements:
(*ar)[1][2] = 3;
// Free the memory.
free(ar); ar = nullptr;
It would be extremely rare that some one would use such a code construct. But the language allows it.