The CDF Engineer Recruitment Test

Share this Article


Instructions for attempting Test:Please follow the following instructions explicitly.

1- Copy and paste the entire test to MS Word

2- Write answers below each question. You have until the deadline below to work on this test freely.

3- Section 0 is mandatory to attempt

4- From Section 1 – 5, you will only be graded against the best two sections answered. The rest will not be considered in the evaluation.

5- We suggest you attempt all questions

6- You are encouraged to use online materials, textbooks and other reference guides to answer

6- When finished, email the completed document to

7- Based on the results of the test, we will get back to you within a few days.

Also, please note the following:

  • Test can be submitted only once
  • Please Attach your NIC copy (or number) with the test
  • Explicitly mention the job position in the email subject

Section 0: General Questions

Question 1

Situation: You were asked to come up with the object level design for one module of the system. Your design reflects your experience on similar work in the past. However, some seniors in the company disapprove of your design and ask you to implement the solution another way. They do not seem to have any basis for their request except that they have another perspective for the application in their minds. What’s more, you feel that your design would be more efficient for the particular situation. What would you do?

Question 2

You are a key part of a team that is building an important software product for a client. You have 5 days before go-live, and your team is on-track to make the software ready for production by then. You are personally responsible for the most critical portion of the project.

The client will be formally launching this application globally from a special Launch Event that will be held in 5 days. The client has booked a 3000-seat conference hall for the launch event, and all the preparations are in place. More than 500 news reporters from leading international news magazines will be attending.

Today, you find out that a close family member — your father — has suddenly fallen ill, and will need to be hospitalized for one week. He will need your close support and attention.

Realizing how much is at stake, what would you propose to your supervisor what the company should do in this situation? How would you present the situation to the supervisor? (Please explain less than 20 lines)

Question 3

You are given a project by a client that needs 80 man-hours for development of a certain item, and you have 3 other team members to complete the project. Given a deadline of two weeks, tell us how you would divide your work into phases according to time in order to successfully release the software to the clients

Question 4

Improve on the usability and user-friendliness of the following remote control, keeping the following in mind:

  • The gadget is multi-purposed: It can be used as a garage-opener and a TV remote.
  • The gadget will be made specially for elderly people.

Primary functionality includes:

1. Changing channels
2. Adjusting volume
3. Opening and closing the garage

You can change anything from the color to the positions of the buttons. You can also remove any buttons that you wish, or add additional buttons provided you state their purpose clearly.

Section 1: Software Questions

Question 1

Q: What does the following code do? (describe in 3 lines in english)

 ( (n & (n-1) == 0) //n = 2,3,4,5...

Question 2

Q: Write out the console output that would be seen with the following code. If it is incorrect, describe how to fix it.

unsigned int i;
for (i = 100; i <= 0; –i)

Question 3

Q: Describe how to create an object oriented program in ANSI-C
(40 lines or less)

Question 4

Q: Write ANSI-C code to count the number of ONE bits in an integer
A- Write an iterative solution
B- Write a recursive solution
C- Compare the two
D- In what type of software is this algorithm commonly used?

Question 5

Q: Write down the code that implements a state-graph as a circular singly linked list data structure. These are the requirements:

  • The linked list will be used to implement a state-graph.
    • Every state will be implemented as a function, and the linked list will contain pointers to each of the functions that describe states.
    • The state machine will keep looping through the entire list to execute the states
  • The total code must not be longer than 5 lines of software.
  • The language used must be ANSI-C without any vendor-specific API / data stucture (e.g. no / C# artifacts)

[Hint: You can assume that the size of the address bus (pointer size) is 2 bytes]
Write down any assumptions you take in the code with regards to the behaviour of the functions

Section 2: Embedded Software Questions

Question 1

Q. When would context-switching become a prohibitive bottleneck in real-time system performance? Why? Cite some examples.

Question 2

A- Describe, in english, what the mysteryFunction below does

unsigned short mysteryFunction(const unsigned short num){
 unsigned short patternOne = 0x55;
 unsigned short patternTwo = 0xAA; 

 patternTwo &= num;
 patternOne &= num; 

 patternTwo <<= 1;
 patternOne >>= 1; 

 return (patternOne | patternTwo);

B- The code segment above is too inefficient — it takes up too much stack space and uses many load / store instructions.
Re-write the above function so that it is more efficient
(Hint: Only one line of code is needed, and it should not use any local variables)

Question 3

Q: You were trying to implement the FAT file system into the design of a new device but is too large to fit into your system.

Design a minimal file system structure. What are the most essential functions that will exist in the file system structure? How would you determine the size of the blocks?

Question 4

A- What is a state machine?
[Research online] [Answer in less than 5 lines]
B- How can a state machine be implemented in software using recursion?
C- A state machine was implemented recursively, but this has started to result in stack overflows. Why is this occuring?
D- Assuming the error in (C) occurs exactly because of the reason you have given, how would the implementation be fixed in order to prevent those overflows?

Question 5

You just finish creating embedded software that will run on a micro-controller. You have the software connected to an LCD device temporarily so that you can print out debug traces.

The software implements a communication protocol, which is sending digital data to the processor at 66Hz.

However, when you start testing you find that your application never receives the data, even when it is sent to it. You step through every single line of code, but there are no evident errors in any line. The debug traces all show that the values are valid throughout the test. However, the receive buffer only gets the first two bytes from the incoming data.

You also check the communication link thoroughly and there are no packet / byte losses on the line.

What could be the cause of this error? How would you fix it?

Question 6

A- Write pseudo-code that decompresses a JPEG image and shows it on the screen. (you may find the JPEG decoding algorithm online)

B- In which parts of this code can further optimizations be made? (i.e. by design, which of the parts can be refined without breaking the algorithm)

C- If you were to implement this in C, which data structures would you use to get the best performance from the code? Compare a number of data structures.

D- How would your choice of data structures change if you were using C++?

E- How would your choice of data structures change if you were using multi-threading?

Section 3: Platform Software Questions

Question 1

A) What is the difference between a thread and a process?

B) When would you want to create a multi-processed application but not a multi-threaded application?

Question 2

A) What is the general purpose of a heartbeat server? (research online) (answer in less than 5 lines)

B) Describe one good example of a system that can use a heartbeat server, and one bad example of such a system.

C) The heart-beat mechanism may be prohibitively inaccurate for certain types of systems — Name one example where that is true. How could we improve this mechanism for that system? Describe your recommendations. (less than 5 lines)

Question 3

Q: How would you implement a tree-based data structure as an array?

A- Describe the implementation — how would the array by structured [Answer in less than 10 lines]

B- Write pseudo-code (or C/C++ code) to find any item in the ‘tree’

C- How would you add or remove items from the ‘tree’?

[Describe in 5 lines]

Question 4

Q: Is it possible to create a piece of software that calculates the fibonacci sequence with a total run-time cost of 0 (zero)? If so, how could that be done? (Just describe the basic technique used)

[Hint: A run-time cost of zero means that the program calculates the results of the fibonacci even before the code is executed]

Question 5

One of your applications has the following infrastructure architecture:

Your software application will be installed on multiple servers in order to serve the total set of requests for it.

To make the system architecture simpler, all of those servers are bound together into one virtual server cluster. For each incoming request, the ‘virtual server manager’ will decide which actual machine to send the request to.

A) Describe the high-level steps for a load-balancing algorithm to implement on the ‘virtual server manager’ that will ensure that all physical servers are used evenly. (answer in less than 40 lines)
The basic requirements are:

  • Each incoming request should be sent to the server that is the ‘least busy’ at that time.
  • All requests will be executed by the actual server (after being forwarded) in a fixed amount of time.
  • All the requests will be processed with different priorities at the ‘virtual server manager’ — ‘high-priority’ requests will always be processed first, and then ‘low-priority’ requests.
  • All the requests must be processed and forwarded by the ‘virtual server manager’ within a limited time. The manager cannot “store” the requests to “forward” at a later time.

Your design must describe how:

  1. The virtual server manager will determine which server is ‘free’
  2. How your scheme will process requests of different priorities — what happens if a low-priority request is received followed immediately by a high-priority request.
  3. The scheme ensures that all requests are forwarded in real-time, given that “Store-and-forward” cannot be used as a message forwarding scheme.

B) Would you recommend another infrastructure design (i.e. rearraging the servers to make the system more optimal?) Describe your recommended solution (not more than 3 lines)

Section 4: Hardware and Digital Logic Questions

Question 1

A- Compare the difference between using an IRQ line and key-wakeup interrupts to connect peripheral ICs (from a hardware perspective).

B- How is “addressing” implemented in a system-wide bus that connects the processors with peripheral ICs?

Question 2

A- How are display buffers implemented in hardware? (Research online)

B- Suppose the implementation you described in (A) is used in a laptop. How would your implementation change if a Smart-LCD was used in the laptop?

Question 3

Q) A- Build the technical design of a basic computer CD-ROM player. The basic requirements are:

  • Should be able to play music CDs
  • Should have a simple data redundancy and protection scheme on it

Describe the functional blocks of the hardware and software system, as well as physical-level design and schematics.

B- Describe, in high-level pseudo-code, the logic embedded into the CDROM micro-controller.

C- At what RPMs would the central CD-Rom motor run in order to play music CDs? Write the steps of the calculation. What type of motor would this be?

D- How would you create an abstracted API for the CDROM that is exposed to the application-software? How would you make the API transparent from the data-redundancy checks? Explain the design (30 lines or less).

E- Write the specification number and online web-link to the International Standards document that covers the design of modern-day CD-Rom systems and software. (I.e. find this online and enter it here)

Question 4

Q) Your team has designed a hardware product, which is nearing final production. All manufacturing contracts are ready, and production is about to ramp up. The PCBs are being manufactured, so are the plastic housings.

A beta test is organized, where 1000 units of the product are given to customers to test for free. During the Beta Test, your customers tell you that the product does not have an ON/OFF (power) switch, and because of that the product is very confusing.

A) How will you present this to the management as a trade-off? (Write down examples)

B) If management decides that the switch must be included, but that no deadlines can be changed, what will be the quickest and least-cost way of incorporating the switch in the design?

Question 5

You are hired by a leading commercial airplane manufacturer. They think that the cockpit of the plane has too many levers and buttons, and they want to create a brand new cockpit dashboard based on touchscreen computer displays (as in ATM machines).

The requirement of the new dashboard is “the pilot should immediately be able to find the option he wants, when he wants to find it, based on the action he is performing at that moment”.

E.g. During takeoff or landing, it may be helpful to see the controls related to the landing gear. At other points during the flight, those controls may not be visible.

Describe what you would propose as the design of the hardware of the system

Section 5: GUI and Usability Design

Question 1

A- How are display buffers implemented in the firmware / OS of a device (research online)?

B- How is 24-bit RGB display data stored in the buffer? Describe for a 1024×768 pixel screen. (Research Online)

C- A device has a display buffer that shows a picture. The picture is stored in 24-bit RGB. You want to give the user the ability to rotate the image 90 degrees (as is common in current day imaging programs). Describe the algorithm (in high-level pseudo code) to achieve this.

D- What are the major bottlenecks of your algorithm from (C)? Can you optimize the algorithm further by creating abstracted representations of the data?

Question 2

Describe the functional software blocks of the design of a “layered” windowing system. The requirements are

* All applications will always exist as ‘full screen windows’.

* All the open applications will existing in an individual layer, and only the ‘active’ application will be visible at the top layer.

* Layers can be moved up and down in the stack order.

Question 3

A- Compared to Windows XP, what is special about icons in the “Apple Aqua” or ‘Glossy’ UI look? [Research Online] [Be explicit about the technical visual differences]

B- Suppose one of our clients is Microsoft, and they ask you to create an enhancement to their Windows GUI in C++ that will automatically create the ‘glossy’ look from all their existing icon files. Your piece of software will be triggered from the “icon file loader” module in the software. Describe what algorithm your software will implement (high-level logic)

C- What — in your opinion — should the design be of a “brushed metal” GUI? What about a “piano black” GUI? How would those be implemented in software (design the key high-level logic of the algorithms involved)

Question 4

Your clients have given you an application that they have a hard time using, because they find the user interface confusing. They would like you to suggest improvements.

A- The application categorizes all of their products together in a tree-based visual structure (just like Windows explorer), but the clients have to click too many times to find relevant products, and relevant related accessories to the products. How would you propose the software UI be changed to address this issue (you can describe changes at the control level, the data representation level, or even just in the visual style such as colors.) [Explain your answer in 30 lines or less]

B- The application makes the users add a product, add accessories, add discounts, add shipping partners, add credit card information, and finally package this all together as a report. However, currently they have to go through a series of 6 screens in order to do all of this (clicking ‘next’ along the way). Now, they would like all of this work to happen from the same screen. Propose a UI to them [You may attach a rough sketch diagram, or CLEARLY describe in 30 lines or less]

C- The client tries to implement a solution to the issue in (B). Now, they have one screen but it has almost 80 different text fields in forms to fill in. The client gives you the following requirement “Make this so intuitive that it is dramatically easier to use”. What would you propose to the client?

Question 5

Sometimes, in software, icons or graphics “fly-out” of a certain part of the screen.

A- How is the animation actually implemented in software? [Research online]

B- There might be different ‘animation splines’ for different types of behaviour of the software. Describe how animation splines would be stored as a data stucture. How would the UI Control or Graphic know which Spline to use for a particular animation?

Question 6

A- How are GUI Resources (images, text styles etc.) stored on the disk in traditional windowing systems? Compare CSS with the design of MFC, .NET, and Linux Gnome and Linux X-Server. [You are encouraged to research this online. Answer in less than 15 lines]

B- Often the performance bottleneck becomes the code that loads up the resources from the disk before displaying them on screen. This is because accessing the disk each time takes a long time, and because there are many disk accesses.

Describe key design points of a software / algorithm which could improve the performance of the resource loader. The design should attempt to minimize the disk access.

E.g if you think a cache would help, describe the caching scheme. Other suggested approaches are also welcome.

Facebook comments:



    I received job news on yahoo group of FAST-NU students on 12th of October 2006. I am not sure whether I must apply now or not. Please reply me if you can give us any benifit in this regard. Thanks
    Mudasser Hameed

  • Imran Mehmood

    I too got this news far after its deadline. So if we submit this test now will you consider us for these jobs or for jobs in future.
    Imran Mehmood

Leave a Reply


Recent Posts

  • Events General Mobile Apps Container Run a continuation of politically motivated apps

    Container Run a continuation of politically motivated apps

    First we had Angry Imran which brought smiles and some short lived fun for us during the election campaign. Then came Gullu Butt following the incident of Model Town Lahore, which stayed on top of charts (Pakistan play store) for quite some while. Also Gullu Butt made an update with having the famous “Aam Khaiyga” quote form Aamir Liaqat in which a character resembling Aamir Liaqt throws mangoes and the Gullu Butt character tries to catch them. Gullu butt currently has more than 100,000 Installs

    And now during this extremely politically tense situation which had the whole nation on its toes on 14th August we have another app continuing the …

    Read more →
  • Announcements Featured Startup General aims to help student make better decision regarding their future. aims to help student make better decision regarding their future. aims to solve an age old problem for our students, where to go next?

    If you have just completed your primary school which college to pick, if you have completed your college which university to pick. There has always been lack of information or rather consolidated information regarding these questions. The best source till now has always been relatives and friends (mostly of your parents). So some uncle did CA and made a good living you should talk to him and decide, or daughter of my sister completed her medical and is practicing follow that career.

    The fact that online presence of our existing universities are limited and not …

    Read more →
  • General Mobile Apps Eccentria Technologies launches an app which shoots to the top of the charts

    Eccentria Technologies launches an app which shoots to the top of the charts

    Whoa!! this was quick so Eccentia technologies launched an app a few days ago called “Ajj Kia Pakaen” or what to cook today and today it has reached the top of charts for Pakistani Stores on iTunes and google play store.

    “Ajj Kia Pakaen” is the most common question asked at every house hold in the morning. The ladies of the family have a hard time deciding what to cook for the day. The app has a fun interface and is simple to use, you fire it up, and it gives you an option of what to cook for the day, if you like the option you can check the …

    Read more →
  • Coffee Session General Marketing/Adv Rise of facebook marketing in Pakistan

    Rise of facebook marketing in Pakistan


    Until a few years back we used to have closed groups and forums, which gathered the like minded people and anyone targeting the online audience would tap into that forum and market his/her services. So PakGamers , PakPassion initially even PakWheels used to be driven by members talking about what they loved, people used to create marketing and sales opportunities from within those discussions (so you could get a good router cheap or a gaming PC etc).
    The advent of facebook changed all that, most of the forum goers moved to the new social media. It also made a very attractive market place for some one who does not …

    Read more →
  • General Getting back

    Getting back

    I  have been out of blogging for a long long long time, a lot of things happening on personal front (including a little startup I have ben doing my self). However during my absence I met a lot of people who had followed GreenWhite at its peak, read the articles regularly.

    I had hope there would be some one else who would come ahead and cover everything going on and around us in the local tech world. There are some guys doing a great job, but for some reason I still could not find one source where I can go and read about everything, so my routine usually is to …

    Read more →
  • General Mobile Apps Software & I.T. GeniTeam launches official app for Pakistan Idol

    GeniTeam launches official app for Pakistan Idol

    GeniITeam has successfully launched an official app for PakistanIdol. This is one of the first collaboration between a reality game show and a local app development company. I am sure a lot more would follow. Previously we have seen seenreport becoming the basis of mostly all channels citizen reporting system (Like Geo Dost). This is a healthy sign and with the advent of 3G round the corner it should become a business generator for our local firms.

    App allows you to follow the contestants that you like, promote them, comment on live feedback on an episode. It offers official content from the show since it is developed with partnership with …

    Read more →
  • General 10Pearls and National Geographic Release A Geography Challenge App

    10Pearls and National Geographic Release A Geography Challenge App

    10Pearls, one of the leading Pakistani IT companies, has recently added another feather to its cap. This time, in partnership with National Geographic, 10Pearls has released the new and improved GeoBee Challenge App – an interactive app to challenge and grow the geographic knowledge of the users.

    Each year thousands of schools in the United States participate in the National Geographic Bee using materials prepared by the National Geographic Society. The competition is designed to encourage geography in the classroom, ignite student interest in the world around them, and increase public awareness about geography. Schools with students in grades four through eight are eligible for this entertaining and challenging test …

    Read more →
  • General 10Pearls Spins Off Game Plan8

    10Pearls Spins Off Game Plan8

    It’s heartening to see that Pakistani IT companies have now started to diversify themselves into non traditional areas, and are competing with global players in areas such as gaming. We have received information that 10Pearls, one of the leading  mobile and enterprise web development services companies in Pakistan, has spun-off a separate entity focused solely on developing and publishing casual mobile games.  The new entity, Game Plan8, will focus on creating 2D and 3D games for the iOS, Google Android, Kindle, Facebook and other platforms. Details can be seen on the company’s official press release at


    Read more →
  • General Telecom CCP Gives Guidelines Against Telecom Companies’ Deceptive Marketing

    CCP Gives Guidelines Against Telecom Companies’ Deceptive Marketing

    If only were there two things when it comes to the law, firstly the fear of breaking it and by passing the legal authority, and secondly, implementation of the law given full dedication, there would have been less competency and dishonesty in business and society. However, keeping good faith, the Competition Commission of Pakistan (CCP) has put forward “Deceptive Marketing Guidelines” which will maintain the Section 10 of the Competition Act, 2010. In order to enforce this part of the law and stop anti-competitive conduct on part of the telecom companies in advertising, the guidelines have been shared with Pakistan Telecommunication Authority (PTA) and other concerned telecommunication sector members, in …

    Read more →